Prettied up the code to Campware coding conventions.
This commit is contained in:
parent
948301794a
commit
8ff09b61b9
|
@ -18,12 +18,12 @@ class uiSubjects
|
||||||
{
|
{
|
||||||
$this->Base->redirUrl = $this->suRedirUrl;
|
$this->Base->redirUrl = $this->suRedirUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRedir()
|
function setRedir()
|
||||||
{
|
{
|
||||||
$this->Base->redirUrl = $this->redirUrl;
|
$this->Base->redirUrl = $this->redirUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAddSubjectForm
|
* getAddSubjectForm
|
||||||
*
|
*
|
||||||
|
@ -78,7 +78,7 @@ class uiSubjects
|
||||||
} else {
|
} else {
|
||||||
$this->Base->_retMsg('Group "$1" added.', $request['login']);
|
$this->Base->_retMsg('Group "$1" added.', $request['login']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ class uiSubjects
|
||||||
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'?act=SUBJECTS"');
|
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'?act=SUBJECTS"');
|
||||||
unset ($mask['chgPasswd']['oldpasswd']);
|
unset ($mask['chgPasswd']['oldpasswd']);
|
||||||
} else {
|
} else {
|
||||||
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'"');
|
$mask['chgPasswd']['cancel']['attributes'] = array('onClick' => 'location.href="'.UI_BROWSER.'"');
|
||||||
}
|
}
|
||||||
$this->Base->_parseArr2Form($form, $mask['chgPasswd']);
|
$this->Base->_parseArr2Form($form, $mask['chgPasswd']);
|
||||||
$form->setConstants(array('login' => $login));
|
$form->setConstants(array('login' => $login));
|
||||||
|
@ -148,13 +148,13 @@ class uiSubjects
|
||||||
$this->Base->_retMsg("Passwords did not match.");
|
$this->Base->_retMsg("Passwords did not match.");
|
||||||
$this->Base->redirUrl = $_SERVER['HTTP_REFERER'];
|
$this->Base->redirUrl = $_SERVER['HTTP_REFERER'];
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects')) {
|
if ($this->Base->gb->checkPerm($this->Base->userid, 'subjects')) {
|
||||||
$this->setSuRedir();
|
$this->setSuRedir();
|
||||||
} else {
|
} else {
|
||||||
$this->setRedir();
|
$this->setRedir();
|
||||||
|
|
||||||
if ($this->Base->login !== $request['login']){
|
if ($this->Base->login !== $request['login']){
|
||||||
$this->Base->_retMsg('Access denied.');
|
$this->Base->_retMsg('Access denied.');
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -166,14 +166,14 @@ class uiSubjects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PEAR::isError($ret = $this->Base->gb->passwd($request['login'], $request['oldpasswd'], $request['passwd'], $this->Base->sessid))) {
|
if (PEAR::isError($ret = $this->Base->gb->passwd($request['login'], $request['oldpasswd'], $request['passwd'], $this->Base->sessid))) {
|
||||||
$this->Base->_retMsg($ret->getMessage());
|
$this->Base->_retMsg($ret->getMessage());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (UI_VERBOSE) {
|
if (UI_VERBOSE) {
|
||||||
$this->Base->_retMsg('Password changed.');
|
$this->Base->_retMsg('Password changed.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,23 +303,23 @@ class uiSubjects
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function isMemberOf($groupname)
|
function isMemberOf($groupname)
|
||||||
{
|
{
|
||||||
if ($gid = $this->Base->gb->getSubjId($groupname)) {
|
if ($gid = $this->Base->gb->getSubjId($groupname)) {
|
||||||
$members = $this->getGroupMember($gid);
|
$members = $this->getGroupMember($gid);
|
||||||
if (is_array($members)) {
|
if (is_array($members)) {
|
||||||
foreach($members as $member) {
|
foreach($members as $member) {
|
||||||
if ($member['id'] === $this->Base->userid) {
|
if ($member['id'] === $this->Base->userid) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue