Fix code style (remove backticks).

This commit is contained in:
Daniel Rojas
2014-04-28 10:10:59 -04:00
parent b54b361585
commit 91b7f50556
6 changed files with 94 additions and 94 deletions

View File

@@ -213,31 +213,31 @@ class User
if ($form['USR_REPLACED_BY'] != '') {
$oReplacedBy = \UsersPeer::retrieveByPK($form['USR_REPLACED_BY']);
if (is_null($oReplacedBy)) {
throw new \Exception('`usr_replaced_by`:'.$form['USR_REPLACED_BY'].' '.\G::LoadTranslation('ID_AUTHENTICATION_SOURCE_INVALID'));
throw new \Exception('usr_replaced_by:'.$form['USR_REPLACED_BY'].' '.\G::LoadTranslation('ID_AUTHENTICATION_SOURCE_INVALID'));
}
}
if ($form['USR_COUNTRY'] != '') {
$oCountry = \IsoCountryPeer::retrieveByPK($form['USR_COUNTRY']);
if (is_null($oCountry)) {
throw new \Exception('Invalid value for `usr_country`: '.$form['USR_COUNTRY']);
throw new \Exception('Invalid value for usr_country: '.$form['USR_COUNTRY']);
}
}
if ($form['USR_CITY'] != '') {
$oCity = \IsoSubdivisionPeer::retrieveByPK($form['USR_COUNTRY'], $form['USR_CITY']);
if (is_null($oCity)) {
throw new \Exception('Invalid value for `usr_city`: '.$form['USR_CITY']);
throw new \Exception('Invalid value for usr_city: '.$form['USR_CITY']);
}
}
if ($form['USR_LOCATION'] != '') {
$oLocation = \IsoLocationPeer::retrieveByPK($form['USR_COUNTRY'], $form['USR_LOCATION']);
if (is_null($oLocation)) {
throw new \Exception('Invalid value for `usr_location`: '.$form['USR_LOCATION']);
throw new \Exception('Invalid value for usr_location: '.$form['USR_LOCATION']);
}
}
if ($form['USR_COUNTRY'] != '') {
$oReplacedBy = \IsoCountryPeer::retrieveByPK($form['USR_COUNTRY']);
if (is_null($oReplacedBy)) {
throw new \Exception('Invalid value for `usr_country`: '.$form['USR_COUNTRY']);
throw new \Exception('Invalid value for usr_country: '.$form['USR_COUNTRY']);
}
}
if (isset($arrayData['USR_UID'])) {
@@ -247,10 +247,10 @@ class User
}
$sConfirm = $this->testPassword($form['USR_NEW_PASS']);
if ($sConfirm['STATUS'] != 1) {
throw new \Exception('`usr_new_pass`. '.$sConfirm['DESCRIPTION']);
throw new \Exception('usr_new_pass. '.$sConfirm['DESCRIPTION']);
}
if ($form['USR_NEW_PASS'] != $form['USR_CNF_PASS']) {
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
throw new \Exception('usr_new_pass or usr_cnf_pass. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
}
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
if (!isset($form['USR_CITY'])) {
@@ -266,45 +266,45 @@ class User
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
$criteria->add(\UsersPeer::USR_USERNAME, utf8_encode($arrayData['USR_USERNAME']));
if (\UsersPeer::doCount($criteria) > 0) {
throw new \Exception('`usr_username`. '.\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
throw new \Exception('usr_username. '.\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
}
if ($form['USR_USERNAME'] == '') {
throw new \Exception('`usr_name`. '.\G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME'));
throw new \Exception('usr_name. '.\G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME'));
} else {
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
}
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
if ($form['USR_FIRSTNAME'] == '') {
throw new \Exception('`usr_firstname`. '.\G::LoadTranslation('ID_MSG_ERROR_USR_FIRSTNAME'));
throw new \Exception('usr_firstname. '.\G::LoadTranslation('ID_MSG_ERROR_USR_FIRSTNAME'));
} else {
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
}
if ($form['USR_LASTNAME'] == '') {
throw new \Exception('`usr_lastname`. '.\G::LoadTranslation('ID_MSG_ERROR_USR_LASTNAME'));
throw new \Exception('usr_lastname. '.\G::LoadTranslation('ID_MSG_ERROR_USR_LASTNAME'));
} else {
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
}
if ($form['USR_EMAIL'] == '') {
throw new \Exception('Invalid value specified for `usr_email`, can`t be null.');
throw new \Exception('Invalid value specified for usr_email, can not be null.');
} else {
if (!filter_var($form['USR_EMAIL'], FILTER_VALIDATE_EMAIL)) {
throw new \Exception('`usr_email`. '.\G::LoadTranslation('ID_INCORRECT_EMAIL'));
throw new \Exception('usr_email. '.\G::LoadTranslation('ID_INCORRECT_EMAIL'));
} else {
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
}
}
if ($form['USR_DUE_DATE'] == '') {
throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
throw new \Exception('usr_due_date. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
} else {
$dueDate = explode("-", $form['USR_DUE_DATE']);
if (ctype_digit($dueDate[0])) {
if (checkdate($dueDate[1], $dueDate[2], $dueDate[0]) == false) {
throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
throw new \Exception('usr_due_date. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
} else {
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
}
} else {
throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
throw new \Exception('usr_due_date. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
}
}
$aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s');
@@ -313,16 +313,16 @@ class User
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
$statusWF = $form['USR_STATUS'];
if ($form['USR_STATUS'] == '') {
throw new \Exception('Invalid value specified for `usr_status`, can`t be null');
throw new \Exception('Invalid value specified for usr_status, can not be null');
} else {
if ($form['USR_STATUS'] == 'ACTIVE' || $form['USR_STATUS'] == 'INACTIVE' || $form['USR_STATUS'] == 'VACATION') {
$aData['USR_STATUS'] = $form['USR_STATUS'];
} else {
throw new \Exception('`usr_status`. Invalid value for status field.');
throw new \Exception('usr_status. Invalid value for status field.');
}
}
if ($form['USR_ROLE'] == '') {
throw new \Exception('Invalid value specified for `usr_role`, can`t be null');
throw new \Exception('Invalid value specified for usr_role, can not be null');
} else {
require_once (PATH_RBAC_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Roles.php");
$oCriteria = new \Criteria('rbac');
@@ -333,7 +333,7 @@ class User
if ($oDataset->getRow()) {
$aData['USR_ROLE'] = $form['USR_ROLE'];
} else {
throw new \Exception('`usr_role`. Invalid value for role field.');
throw new \Exception('usr_role. Invalid value for role field.');
}
}
try {
@@ -398,13 +398,13 @@ class User
}
}
if ($countPermission != 1) {
throw new \Exception('This user: '.$usrLoggedUid. ', can`t update the data.');
throw new \Exception('This user: '.$usrLoggedUid. ', can not update the data.');
}
$criteria = new \Criteria();
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
$criteria->add(\UsersPeer::USR_USERNAME, utf8_encode($arrayData['USR_USERNAME']));
if (\UsersPeer::doCount($criteria) > 0) {
throw new \Exception('`usr_username`. '.\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
throw new \Exception('usr_username. '.\G::LoadTranslation('ID_USERNAME_ALREADY_EXISTS', array('USER_ID' => $arrayData['USR_USERNAME'])));
}
if (isset($usrUid)) {
$form['USR_UID'] = $usrUid;
@@ -427,7 +427,7 @@ class User
if (isset($form['USR_PASSWORD'])) {
if ($form['USR_PASSWORD'] != '') {
if ($form['USR_NEW_PASS'] != $form['USR_CNF_PASS']) {
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
throw new \Exception('usr_new_pass or usr_cnf_pass. '.\G::LoadTranslation('ID_NEW_PASS_SAME_OLD_PASS'));
}
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "UsersProperties.php");
@@ -464,7 +464,7 @@ class User
}
}
$sDescription .= '' . \G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY');
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.$sDescription);
throw new \Exception('usr_new_pass or usr_cnf_pass. '.$sDescription);
}
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
if (!is_array($aHistory)) {
@@ -487,7 +487,7 @@ class User
$sDescription = \G::LoadTranslation('ID_POLICY_ALERT') . ':<br /><br />';
$sDescription .= ' - ' . \G::LoadTranslation('PASSWORD_HISTORY') . ': ' . PPP_PASSWORD_HISTORY . '<br />';
$sDescription .= '<br />' . \G::LoadTranslation('ID_PLEASE_CHANGE_PASSWORD_POLICY') . '';
throw new \Exception('`usr_new_pass or usr_cnf_pass`. '.$sDescription);
throw new \Exception('usr_new_pass or usr_cnf_pass. '.$sDescription);
}
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
$sLastPassw = array_shift($aHistory);
@@ -508,7 +508,7 @@ class User
}
if ($form['USR_EMAIL'] != '') {
if (!filter_var($form['USR_EMAIL'], FILTER_VALIDATE_EMAIL)) {
throw new \Exception('`usr_email`. '.\G::LoadTranslation('ID_INCORRECT_EMAIL'));
throw new \Exception('usr_email. '.\G::LoadTranslation('ID_INCORRECT_EMAIL'));
} else {
$aData['USR_EMAIL'] = $form['USR_EMAIL'];
}
@@ -517,12 +517,12 @@ class User
$dueDate = explode("-", $form['USR_DUE_DATE']);
if (ctype_digit($dueDate[0])) {
if (checkdate($dueDate[1], $dueDate[2], $dueDate[0]) == false) {
throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
throw new \Exception('usr_due_date. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
} else {
$aData['USR_DUE_DATE'] = $form['USR_DUE_DATE'];
}
} else {
throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
throw new \Exception('usr_due_date. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
}
}
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
@@ -539,7 +539,7 @@ class User
if ($oDataset->getRow()) {
$aData['USR_ROLE'] = $form['USR_ROLE'];
} else {
throw new \Exception('`usr_role`. Invalid value for field.');
throw new \Exception('usr_role. Invalid value for field.');
}
$this->updateUser($aData, $form['USR_ROLE']);
} else {
@@ -548,7 +548,7 @@ class User
if ($form['USR_COUNTRY'] != '') {
$oReplacedBy = \IsoCountryPeer::retrieveByPK($form['USR_COUNTRY']);
if (is_null($oReplacedBy)) {
throw new \Exception('Invalid value for `usr_country`: '.$form['USR_COUNTRY']);
throw new \Exception('Invalid value for usr_country: '.$form['USR_COUNTRY']);
} else {
$aData['USR_COUNTRY'] = $form['USR_COUNTRY'];
$aData['USR_CITY'] = '';
@@ -558,7 +558,7 @@ class User
if ($form['USR_CITY'] != '') {
$oCity = \IsoSubdivisionPeer::retrieveByPK($form['USR_COUNTRY'], $form['USR_CITY']);
if (is_null($oCity)) {
throw new \Exception('Invalid value for `usr_city`: '.$form['USR_CITY']);
throw new \Exception('Invalid value for usr_city: '.$form['USR_CITY']);
} else {
$aData['USR_CITY'] = $form['USR_CITY'];
}
@@ -566,7 +566,7 @@ class User
if ($form['USR_LOCATION'] != '') {
$oLocation = \IsoLocationPeer::retrieveByPK($form['USR_COUNTRY'], $form['USR_LOCATION']);
if (is_null($oLocation)) {
throw new \Exception('Invalid value for `usr_location`: '.$form['USR_LOCATION']);
throw new \Exception('Invalid value for usr_location: '.$form['USR_LOCATION']);
} else {
$aData['USR_LOCATION'] = $form['USR_LOCATION'];
}
@@ -581,7 +581,7 @@ class User
if ($form['USR_REPLACED_BY'] != '') {
$oReplacedBy = \UsersPeer::retrieveByPK($form['USR_REPLACED_BY']);
if (is_null($oReplacedBy)) {
throw new \Exception('`usr_replaced_by`:'.$form['USR_REPLACED_BY'].' '.\G::LoadTranslation('ID_AUTHENTICATION_SOURCE_INVALID'));
throw new \Exception('usr_replaced_by:'.$form['USR_REPLACED_BY'].' '.\G::LoadTranslation('ID_AUTHENTICATION_SOURCE_INVALID'));
} else {
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
}
@@ -689,14 +689,14 @@ class User
}
if ($start) {
if ($start < 0) {
throw (new \Exception( 'Invalid value specified for `start`.'));
throw (new \Exception( 'Invalid value specified for start.'));
} else {
$oCriteria->setOffset($start);
}
}
if ($limit != '') {
if ($limit < 0) {
throw (new \Exception( 'Invalid value specified for `limit`.'));
throw (new \Exception( 'Invalid value specified for limit.'));
} else {
if ($limit == 0) {
return $aUserInfo;
@@ -734,7 +734,7 @@ class User
$aUserInfo = array();
$oUser = \UsersPeer::retrieveByPK($userUid);
if (is_null($oUser)) {
throw (new \Exception( 'This id for `usr_uid`: '. $userUid .' does not correspond to a registered user'));
throw (new \Exception( 'This id for usr_uid: '. $userUid .' does not correspond to a registered user'));
}
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
$oCriteria = new \Criteria();