error handling
This commit is contained in:
parent
68cd9b53aa
commit
db504da5d7
|
@ -942,6 +942,7 @@ class posixAccount extends baseModule implements passwordService {
|
|||
// try to delete directory on all servers
|
||||
for ($i = 0; $i < sizeof($lamdaemonServers); $i++) {
|
||||
$remote = new \LAM\REMOTE\Remote();
|
||||
try {
|
||||
$remote->connect($lamdaemonServers[$i]);
|
||||
$result = $remote->execute(
|
||||
implode(
|
||||
|
@ -955,6 +956,10 @@ class posixAccount extends baseModule implements passwordService {
|
|||
)
|
||||
));
|
||||
$remote->disconnect();
|
||||
}
|
||||
catch (LAMException $e) {
|
||||
$return[] = array('ERROR', $e->getTitle(), $e->getMessage());
|
||||
}
|
||||
// lamdaemon results
|
||||
if (!empty($result)) {
|
||||
$singleresult = explode(",", $result);
|
||||
|
|
|
@ -336,8 +336,15 @@ class quota extends baseModule {
|
|||
* @return array Array which contains status messages. Each entry is an array containing the status message parameters.
|
||||
*/
|
||||
function preDeleteActions() {
|
||||
try {
|
||||
$this->initQuotas();
|
||||
if (!isset($this->quota) || !is_array($this->quota)) return array();
|
||||
}
|
||||
catch (LAMException $e) {
|
||||
return array(array('ERROR', $e->getTitle(), $e->getMessage()));
|
||||
}
|
||||
if (!isset($this->quota) || !is_array($this->quota)) {
|
||||
return array();
|
||||
}
|
||||
// determine if this is a user or group account
|
||||
if ($this->get_scope()=='user') {
|
||||
$attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes();
|
||||
|
@ -427,8 +434,16 @@ class quota extends baseModule {
|
|||
*/
|
||||
function display_html_attributes() {
|
||||
$return = new htmlTable();
|
||||
try {
|
||||
$this->initQuotas();
|
||||
if (!is_array($this->quota)) return $return;
|
||||
}
|
||||
catch (LAMException $e) {
|
||||
$return->addElement(new htmlStatusMessage('ERROR', $e->getTitle(), $e->getMessage()));
|
||||
return $return;
|
||||
}
|
||||
if (!is_array($this->quota)) {
|
||||
return $return;
|
||||
}
|
||||
// get list of lamdaemon servers
|
||||
$serverDescriptions = array();
|
||||
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
|
||||
|
@ -671,8 +686,16 @@ class quota extends baseModule {
|
|||
* @see baseModule::get_pdfEntries()
|
||||
*/
|
||||
function get_pdfEntries($pdfKeys, $typeId) {
|
||||
try {
|
||||
$this->initQuotas();
|
||||
if (!isset($this->quota) || !is_array($this->quota)) return array();
|
||||
}
|
||||
catch (LAMException $e) {
|
||||
logNewMessage(LOG_ERR, $e->getTitle(), $e->getMessage());
|
||||
return array();
|
||||
}
|
||||
if (!isset($this->quota) || !is_array($this->quota)) {
|
||||
return array();
|
||||
}
|
||||
if (sizeof($this->quota) > 0) {
|
||||
$pdfTable = new PDFTable();
|
||||
// get list of lamdaemon servers
|
||||
|
@ -720,8 +743,16 @@ class quota extends baseModule {
|
|||
* @see baseModule::get_uploadColumns()
|
||||
*/
|
||||
function get_uploadColumns($selectedModules, &$type) {
|
||||
try {
|
||||
$this->initQuotas();
|
||||
if (!isset($this->quota) || !is_array($this->quota)) return array();
|
||||
}
|
||||
catch (LAMException $e) {
|
||||
logNewMessage(LOG_ERR, $e->getTitle(), $e->getMessage());
|
||||
return array();
|
||||
}
|
||||
if (!isset($this->quota) || !is_array($this->quota)) {
|
||||
return array();
|
||||
}
|
||||
$return = array();
|
||||
if (sizeof($this->quota) > 0) {
|
||||
// get list of lamdaemon servers
|
||||
|
|
Loading…
Reference in New Issue