示例#1
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
$frm = $HTTP_POST_VARS['form'];
$frm = G::PrepareFormArray($frm);
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$appid = $HTTP_SESSION_VARS['CURRENT_APPLICATION'];
$code = strtoupper($frm['APP_CODE']);
$descrip = $frm['APP_DESCRIPTION'];
//crear nueva applicacion
G::LoadClassRBAC("applications");
$obj = new RBAC_Application();
$obj->SetTo($dbc);
print "xx {$res}";
$res = $obj->applicationCodeRepetido($code);
if ($res != 0 && $res != $appid) {
    G::SendMessage(15, "error");
    header("location: appList.php");
    die;
}
print "xx {$res}";
$uid = $obj->editApplication($appid, $code, $descrip);
header("location: appList.html");
示例#2
0
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
$frm = $_POST['form'];
$pass1 = $frm['PASSWORD'];
$pass2 = $frm['PASSWORD2'];
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
G::LoadClassRBAC('user');
$obj = new RBAC_User();
$obj->SetTo($dbc);
if ($pass1 != $pass2) {
    G::SendMessage(3, 'error');
    header('location: userChangePwd.php');
    die;
}
$obj->SetTo($dbc);
$obj->changePassword($_SESSION['CURRENT_USER'], $pass1);
header('location: userEdit.html');
//header('location: userViewRole.html');
 function deleteCalendar($CalendarUid)
 {
     //if exists the row in the database propel will update it, otherwise will insert.
     $tr = CalendarDefinitionPeer::retrieveByPK($CalendarUid);
     if (!(is_object($tr) && get_class($tr) == 'CalendarDefinition')) {
         //
         return false;
     }
     $defaultCalendars[] = '00000000000000000000000000000001';
     if (in_array($tr->getCalendarUid(), $defaultCalendars)) {
         return false;
     }
     $tr->setCalendarStatus('DELETED');
     $tr->setCalendarUpdateDate('now');
     if ($tr->validate()) {
         // we save it, since we get no validation errors, or do whatever else you like.
         $res = $tr->save();
     } else {
         // Something went wrong. We can now get the validationFailures and handle them.
         $msg = '';
         $validationFailuresArray = $tr->getValidationFailures();
         foreach ($validationFailuresArray as $objValidationFailure) {
             $msg .= $objValidationFailure->getMessage() . "<br/>";
         }
         G::SendMessage("ERROR", $msg);
         //return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
     }
     //return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
     //to do: uniform  coderror structures for all classes
     //if ( $res['codError'] < 0 ) {
     //  G::SendMessageText ( $res['message'] , 'error' );
     //}
 }
示例#4
0
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
$frm = $_POST['form'];
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$parent = $_SESSION['CURRENT_PERM_PARENT'];
$appid = $_SESSION['CURRENT_APPLICATION'];
$code = strtoupper($frm['PRM_CODE']);
$descrip = $frm['PRM_DESCRIPTION'];
//crear nuevo permiso
G::LoadClassRBAC("permissions");
$obj = new RBAC_Permission();
$obj->SetTo($dbc);
$res = $obj->permissionCodeRepetido($code);
if ($res != 0) {
    G::SendMessage(16, "error");
    header("location: permList.php");
    die;
}
$uid = $obj->createPermission($parent, $appid, $code, $descrip);
header("location: permList.html");
示例#5
0
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
$frm = $_POST['form'];
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$roleid = $_SESSION['CURRENT_ROLE_PARENT'];
$appid = $_SESSION['CURRENT_APPLICATION'];
$code = strtoupper($frm['ROL_CODE']);
$descrip = $frm['ROL_DESCRIPTION'];
//crear nuevo rol
G::LoadClassRBAC("roles");
$obj = new RBAC_Role();
$obj->SetTo($dbc);
$res = $obj->roleCodeRepetido($code);
if ($res != 0 && $res != $roleid) {
    G::SendMessage(14, "error");
    header("location: roleList.php");
    die;
}
$uid = $obj->editRole($roleid, $appid, $code, $descrip);
header("location: roleList.html");
示例#6
0
    $frm['USR_USE_LDAP'] = '';
}
$email = $frm['USR_EMAIL'];
$phone = $frm['USR_PHONE'];
$cell = $frm['USR_CELLULAR'];
$fax = $frm['USR_FAX'];
$pobox = $frm['USR_POBOX'];
$userID = $frm['USR_USERNAME'];
$status = $frm['USR_STATUS'];
$due = $frm['USR_DUE_DATE'];
$useLdap = $frm['USR_USE_LDAP'];
$uid = $_SESSION['CURRENT_USER'];
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
G::LoadClassRBAC('user');
$obj = new RBAC_User();
$obj->SetTo($dbc);
$repId = $obj->UserNameRepetido($uid, $userID);
if ($repId != 0) {
    G::SendMessage(6, 'error');
    header('location: userEdit.php');
    die;
}
$obj->SetTo($dbc);
$obj->SetToRBAC(DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$uid = $obj->editUser($uid, $first, $mid, $names, $email, '', '', '', '', $userID, $status, $due, '', '', '');
$obj->Load($uid);
if ($obj->Fields['USR_USE_LDAP'] != $useLdap) {
    $obj->updateLDAP($uid, $obj->Fields['USR_LDAP_SOURCE'], $obj->Fields['USR_LDAP_DN'], $useLdap);
}
header('location: userEdit.html');
//header('location: userViewRole.html');