Permalink
Browse files

Merge pull request #403 from AKSW/fix/deactivateRegistration

Repair deactivateRegistration .ini entry in Erfurt. Fix #390.
  • Loading branch information...
white-gecko committed May 3, 2017
2 parents 7b0f820 + 4b3d1b8 commit 04f8c6121d8f5430cc76878343206a5c36eddd7a
@@ -124,7 +124,8 @@ private function _getApplicationMenu($context = null)
// user sub menu
if ($owApp->erfurt->isActionAllowed('RegisterNewUser')
&& !(isset($owApp->config->ac) && ((boolean)$owApp->config->ac->deactivateRegistration === true))
&& !(isset($owApp->config->ac)
&& ((boolean)$owApp->config->ac->deactivateRegistration === true))
) {
if (!($owApp->erfurt->getAc() instanceof Erfurt_Ac_None)) {
@@ -92,6 +92,10 @@ descriptionHelper.properties.dcDesc2 = "http://purl.org/dc/elements/1.1/descript
descriptionHelper.properties.skosNote = "http://www.w3.org/2004/02/skos/core#note"
descriptionHelper.properties.skosEditorialNote = "http://www.w3.org/2004/02/skos/core#editorialNote"
;;
; AC settings
;;
;ac.deactivateRegistration = true
;;
; List settings
@@ -196,6 +196,16 @@ public function logoutAction()
public function registerAction()
{
OntoWiki::getInstance()->getNavigation()->disableNavigation();
//check if the Register Action is allowed
if (isset($this->_owApp->config->ac)
&& ((boolean)$this->_owApp->config->ac->deactivateRegistration === true)
) {
$this->_helper->viewRenderer->setNoRender();
$this->view->placeholder('main.window.title')->set('Register User');
$message = 'The registration is deactivated, please consult an Admin about this.';
$this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));
return;
}
$this->_helper->viewRenderer->setScriptAction('register');
$this->view->placeholder('main.window.title')->set('Register User');
@@ -358,7 +368,16 @@ public function registerAction()
public function openidregAction()
{
OntoWiki::getInstance()->getNavigation()->disableNavigation();
//check if the Register Action is allowed
if (isset($this->_owApp->config->ac)
&& ((boolean)$this->_owApp->config->ac->deactivateRegistration === true)
) {
$this->_helper->viewRenderer->setNoRender();
$this->view->placeholder('main.window.title')->set('Register User');
$message = 'The registration is deactivated, please consult an Admin about this.';
$this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));
return;
}
// We render a template, that is also used for preferences.
$this->_helper->viewRenderer->setScriptAction('openid');
@@ -549,7 +568,16 @@ public function openidregAction()
public function webidregAction()
{
OntoWiki::getInstance()->getNavigation()->disableNavigation();
//check if the Register Action is allowed
if (isset($this->_owApp->config->ac)
&& ((boolean)$this->_owApp->config->ac->deactivateRegistration === true)
) {
$this->_helper->viewRenderer->setNoRender();
$this->view->placeholder('main.window.title')->set('Register User');
$message = 'The registration is deactivated, please consult an Admin about this.';
$this->_owApp->appendMessage(new OntoWiki_Message($message, OntoWiki_Message::ERROR));
return;
}
// We render a template, that is also used for preferences.
$this->_helper->viewRenderer->setScriptAction('webid');
@@ -60,7 +60,10 @@ public function getContents()
'redirectUri' => urlencode((string)$url)
);
if ($this->_erfurt->getAc()->isActionAllowed('RegisterNewUser')) {
if ($this->_erfurt->getAc()->isActionAllowed('RegisterNewUser')
&& !(isset($this->_owApp->config->ac)
&& ((boolean)$this->_owApp->config->ac->deactivateRegistration === true))
) {
$data['showRegisterButton'] = true;
$data['registerActionUrl'] = $this->_config->urlBase . 'application/register';
$data['openIdRegisterActionUrl'] = $this->_config->urlBase . 'application/openidreg';

0 comments on commit 04f8c61

Please sign in to comment.