diff --git a/openstack/_config.php b/openstack/_config.php index bf777f6..31e1818 100644 --- a/openstack/_config.php +++ b/openstack/_config.php @@ -91,6 +91,7 @@ if (Director::isDev()) { //sangria configuration Object::add_extension('SangriaPage_Controller', 'SangriaPageDeploymentExtension'); +Object::add_extension('SangriaPage_Controller', 'SangriaPageSurveyDetailsExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageStandardizeOrgNamesExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageViewCurrentStoriesExtension'); Object::add_extension('SangriaPage_Controller', 'SangriaPageExportDataExtension'); diff --git a/openstack/code/deployment-survey/DeploymentSurveyPage.php b/openstack/code/deployment-survey/DeploymentSurveyPage.php index c38314f..608d512 100644 --- a/openstack/code/deployment-survey/DeploymentSurveyPage.php +++ b/openstack/code/deployment-survey/DeploymentSurveyPage.php @@ -134,6 +134,7 @@ class DeploymentSurveyPage_Controller extends Page_Controller 'SavePasswordForm', 'SavePassword', 'CheckEmail', + 'CheckName', 'MemberStart' ); @@ -149,6 +150,19 @@ class DeploymentSurveyPage_Controller extends Page_Controller 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() { parent::init(); diff --git a/openstack/code/sangria/SangriaPage.php b/openstack/code/sangria/SangriaPage.php index 21859e2..280e39d 100644 --- a/openstack/code/sangria/SangriaPage.php +++ b/openstack/code/sangria/SangriaPage.php @@ -41,6 +41,10 @@ final class SangriaPage_Controller extends Page_Controller { 'FilterResults', ); + static $url_handlers = array( + 'GET SurveyDetails/$ID' => 'SurveyDetails', + ); + function init() { if(!Permission::check("SANGRIA_ACCESS")) Security::permissionFailure(); parent::init();