allow sending login data only if enableEmail is set

This commit is contained in:
Uwe Steinmann 2017-08-24 08:39:58 +02:00
parent 31284c5688
commit b3a41875b3
3 changed files with 5 additions and 3 deletions

View File

@ -265,7 +265,7 @@ else if ($action == "transferobjects") {
} }
// send login data to user // send login data to user
else if ($action == "sendlogindata") { else if ($action == "sendlogindata" && $settings->_enableEmail) {
/* Check if the form data comes from a trusted request */ /* Check if the form data comes from a trusted request */
if(!checkFormKey('sendlogindata')) { if(!checkFormKey('sendlogindata')) {
UI::exitError(getMLText("admin_tools"),getMLText("invalid_request_token")); UI::exitError(getMLText("admin_tools"),getMLText("invalid_request_token"));

View File

@ -49,7 +49,7 @@ if(isset($_GET['userid']) && $_GET['userid']) {
} }
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'seluser'=>$seluser, 'allusers'=>$users, 'allgroups'=>$groups, 'passwordstrength'=>$settings->_passwordStrength, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot, 'enableuserimage'=>$settings->_enableUserImage, 'undeluserids'=>explode(',', $settings->_undelUserIds), 'workflowmode'=>$settings->_workflowMode, 'quota'=>$settings->_quota, 'strictformcheck'=>$settings->_strictFormCheck)); $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'seluser'=>$seluser, 'allusers'=>$users, 'allgroups'=>$groups, 'passwordstrength'=>$settings->_passwordStrength, 'passwordexpiration'=>$settings->_passwordExpiration, 'httproot'=>$settings->_httpRoot, 'enableuserimage'=>$settings->_enableUserImage, 'undeluserids'=>explode(',', $settings->_undelUserIds), 'workflowmode'=>$settings->_workflowMode, 'quota'=>$settings->_quota, 'strictformcheck'=>$settings->_strictFormCheck, 'enableemail'=>$settings->_enableEmail));
if($view) { if($view) {
$view($_GET); $view($_GET);
} }

View File

@ -168,6 +168,7 @@ $(document).ready( function() {
$quota = $this->params['quota']; $quota = $this->params['quota'];
$workflowmode = $this->params['workflowmode']; $workflowmode = $this->params['workflowmode'];
$undeluserids = $this->params['undeluserids']; $undeluserids = $this->params['undeluserids'];
$enableemail = $this->params['enableemail'];
if($seluser) { if($seluser) {
?> ?>
@ -185,7 +186,8 @@ $(document).ready( function() {
echo '<li><a href="../out/out.TransferObjects.php?userid='.$seluser->getID().'"><i class="icon-share-alt"></i> '.getMLText("transfer_objects").'</a></li>'; echo '<li><a href="../out/out.TransferObjects.php?userid='.$seluser->getID().'"><i class="icon-share-alt"></i> '.getMLText("transfer_objects").'</a></li>';
if($user->isAdmin() && $seluser->getID() != $user->getID()) if($user->isAdmin() && $seluser->getID() != $user->getID())
echo "<li><a href=\"../op/op.SubstituteUser.php?userid=".$seluser->getID()."&formtoken=".createFormKey('substituteuser')."\"><i class=\"icon-exchange\"></i> ".getMLText("substitute_user")."</a></li>\n"; echo "<li><a href=\"../op/op.SubstituteUser.php?userid=".$seluser->getID()."&formtoken=".createFormKey('substituteuser')."\"><i class=\"icon-exchange\"></i> ".getMLText("substitute_user")."</a></li>\n";
echo '<li><a href="../out/out.SendLoginData.php?userid='.$seluser->getID().'"><i class="icon-envelope-alt"></i> '.getMLText("send_login_data").'</a></li>'; if($enableemail)
echo '<li><a href="../out/out.SendLoginData.php?userid='.$seluser->getID().'"><i class="icon-envelope-alt"></i> '.getMLText("send_login_data").'</a></li>';
?> ?>
</ul> </ul>
</div> </div>