Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 799 → Rev 800

/trunk/plugins/viathinksoft/raPages/102_change_email/OIDplusPageRaChangeEMail.class.php
200,10 → 200,10
$ra_email = explode('$',$id)[1];
 
$out['title'] = _L('Change RA email');
$out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
$out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
 
if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = '<p>'._L('You need to <a %1>log in</a> as the requested RA %2 or as admin.',OIDplus::gui()->link('oidplus:login$ra$'.$ra_email),'<b>'.htmlentities($ra_email).'</b>').'</p>';
return;
}
210,13 → 210,13
 
$res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email));
if (!$res->any()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>');
return;
}
 
if (!OIDplus::config()->getValue('allow_ra_email_change') && !OIDplus::authUtils()->isAdminLoggedIn()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = '<p>'._L('This functionality has been disabled by the administrator.').'</p>';
return;
}
237,7 → 237,7
} else {
$ra = new OIDplusRA($ra_email);
if ($ra->isPasswordLess()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] .= '<p>'._L('Attention: You are logged in without password (via LDAP or Google OAuth etc.).').'</p>';
$out['text'] .= '<p>'._L('Therefore, you cannot change your email address, otherwise you would love access to your account!').'</p>';
$out['text'] .= '<p>'._L('If you want to change your email address, then please <a %1>setup a password</a> first, and then use the regular login method to log in using your new email address.', OIDplus::gui()->link('oidplus:change_ra_password$'.$ra_email)).'</p>';
259,10 → 259,10
$auth = explode('$',$id)[4];
 
$out['title'] = _L('Perform email address change');
$out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
$out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
 
if (!OIDplus::config()->getValue('allow_ra_email_change') && !OIDplus::authUtils()->isAdminLoggedIn()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = '<p>'._L('This functionality has been disabled by the administrator.').'</p>';
return;
}
269,7 → 269,7
 
$ra = new OIDplusRA($old_email);
if ($ra->isPasswordLess() && !OIDplus::authUtils()->isAdminLoggedIn()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = '<p>'._L('E-Mail-Address cannot be changed because this user does not have a password').'</p>';
return;
}
276,16 → 276,16
 
$res = OIDplus::db()->query("select * from ###ra where email = ?", array($old_email));
if (!$res->any()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = _L('eMail address does not exist anymore. It was probably already changed.');
} else {
$res = OIDplus::db()->query("select * from ###ra where email = ?", array($new_email));
if ($res->any()) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = _L('eMail address is already used by another RA. To merge accounts, please contact the superior RA of your objects and request an owner change of your objects.');
} else {
if (!OIDplus::authUtils()->validateAuthKey('activate_new_ra_email;'.$old_email.';'.$new_email.';'.$timestamp, $auth)) {
$out['icon'] = 'img/error_big.png';
$out['icon'] = 'img/error.png';
$out['text'] = _L('Invalid authorization. Is the URL OK?');
} else {
$out['text'] = '<p>'._L('Old eMail-Address').': <b>'.$old_email.'</b></p>
310,8 → 310,8
if (!$ra_email) return false;
if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false;
 
if (file_exists(__DIR__.'/treeicon.png')) {
$tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
if (file_exists(__DIR__.'/img/main_icon16.png')) {
$tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
} else {
$tree_icon = null; // default icon (folder)
}