[spalenque] - #7849 *FIXED

This commit is contained in:
santipalenque 2014-12-05 16:44:21 -03:00 committed by Sebastian Marcet
parent 5b2e4c71e9
commit 6ebf90ccc8
3 changed files with 19 additions and 0 deletions

View File

@ -91,6 +91,7 @@ if (Director::isDev()) {
//sangria configuration //sangria configuration
Object::add_extension('SangriaPage_Controller', 'SangriaPageDeploymentExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageDeploymentExtension');
Object::add_extension('SangriaPage_Controller', 'SangriaPageSurveyDetailsExtension');
Object::add_extension('SangriaPage_Controller', 'SangriaPageStandardizeOrgNamesExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageStandardizeOrgNamesExtension');
Object::add_extension('SangriaPage_Controller', 'SangriaPageViewCurrentStoriesExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageViewCurrentStoriesExtension');
Object::add_extension('SangriaPage_Controller', 'SangriaPageExportDataExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageExportDataExtension');

View File

@ -134,6 +134,7 @@ class DeploymentSurveyPage_Controller extends Page_Controller
'SavePasswordForm', 'SavePasswordForm',
'SavePassword', 'SavePassword',
'CheckEmail', 'CheckEmail',
'CheckName',
'MemberStart' 'MemberStart'
); );
@ -149,6 +150,19 @@ class DeploymentSurveyPage_Controller extends Page_Controller
echo json_encode($res); echo json_encode($res);
} }
public function CheckName()
{
$first_name = Convert::raw2sql($this->request->getVar('FirstName'));
$last_name = Convert::raw2sql($this->request->getVar('LastName'));
//Check for existing member name
$res = true;
if ($member = Member::get()->filter(array('FirstName'=>$first_name,'Surname'=>$last_name))->first()) {
$res = false;
}
echo json_encode($res);
}
function init() function init()
{ {
parent::init(); parent::init();

View File

@ -41,6 +41,10 @@ final class SangriaPage_Controller extends Page_Controller {
'FilterResults', 'FilterResults',
); );
static $url_handlers = array(
'GET SurveyDetails/$ID' => 'SurveyDetails',
);
function init() { function init() {
if(!Permission::check("SANGRIA_ACCESS")) Security::permissionFailure(); if(!Permission::check("SANGRIA_ACCESS")) Security::permissionFailure();
parent::init(); parent::init();