Skip to content
Snippets Groups Projects
Commit de4d479a authored by Adrian Lang's avatar Adrian Lang
Browse files

Let actionOK detect auth backend capabilities

parent 8a6e9b06
No related branches found
No related tags found
No related merge requests found
......@@ -343,6 +343,11 @@ function act_revert($act){
global $ID;
global $REV;
global $lang;
// FIXME $INFO['writable'] currently refers to the attic version
// global $INFO;
// if (!$INFO['writable']) {
// return 'show';
// }
// when no revision is given, delete current one
// FIXME this feature is not exposed in the GUI currently
......
......@@ -241,6 +241,7 @@ function actionOK($action){
static $disabled = null;
if(is_null($disabled)){
global $conf;
global $auth;
// prepare disabled actions array and handle legacy options
$disabled = explode(',',$conf['disableactions']);
......@@ -250,6 +251,12 @@ function actionOK($action){
if(isset($conf['subscribers']) && !$conf['subscribers']) {
$disabled[] = 'subscribe';
}
if (is_null($auth) || !$auth->canDo('addUser')) {
$disabled[] = 'register';
}
if (is_null($auth) || !$auth->canDo('modPass')) {
$disabled[] = 'resendpwd';
}
$disabled = array_unique($disabled);
}
......
......@@ -45,7 +45,6 @@ function html_login(){
global $lang;
global $conf;
global $ID;
global $auth;
print p_locale_xhtml('login');
print '<div class="centeralign">'.NL;
......@@ -61,14 +60,14 @@ function html_login(){
$form->addElement(form_makeButton('submit', '', $lang['btn_login']));
$form->endFieldset();
if($auth && $auth->canDo('addUser') && actionOK('register')){
if(actionOK('register')){
$form->addElement('<p>'
. $lang['reghere']
. ': <a href="'.wl($ID,'do=register').'" rel="nofollow" class="wikilink1">'.$lang['register'].'</a>'
. '</p>');
}
if ($auth && $auth->canDo('modPass') && actionOK('resendpwd')) {
if (actionOK('resendpwd')) {
$form->addElement('<p>'
. $lang['pwdforget']
. ': <a href="'.wl($ID,'do=resendpwd').'" rel="nofollow" class="wikilink1">'.$lang['btn_resendpwd'].'</a>'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment