mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
check for su by regular user, call service hooks
This commit is contained in:
parent
1cf7516cc3
commit
3c6bd6bf6f
|
@ -50,15 +50,37 @@ if (isset($_COOKIE["mydms_session"])) {
|
|||
echo json_encode(array('error'=>1));
|
||||
exit;
|
||||
}
|
||||
$dms->setUser($user);
|
||||
if($user->isAdmin()) {
|
||||
if($resArr["su"]) {
|
||||
$user = $dms->getUser($resArr["su"]);
|
||||
|
||||
if($resArr["su"] && $su = $dms->getUser($resArr["su"])) {
|
||||
if($user->isAdmin() || $user->maySwitchToUser($su)) {
|
||||
$user = $su;
|
||||
} else {
|
||||
$session->resetSu();
|
||||
}
|
||||
}
|
||||
$dms->setUser($user);
|
||||
$role = $user->getRole();
|
||||
$dms->noReadForStatus = $role->getNoAccess();
|
||||
|
||||
$notifier = new SeedDMS_NotificationService();
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
||||
if(method_exists($notificationObj, 'preAddService')) {
|
||||
$notificationObj->preAddService($notifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($settings->_enableEmail) {
|
||||
$notifier->addService(new SeedDMS_EmailNotify($dms));
|
||||
$notifier->addService(new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword));
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
||||
if(method_exists($notificationObj, 'postAddService')) {
|
||||
$notificationObj->postAddService($notifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
include $settings->_rootDir . "languages/" . $resArr["language"] . "/lang.inc";
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user