/**
  * Removes this object from datastore and sets delete attribute.
  *
  * @param      Connection $con
  * @return     void
  * @throws     PropelException
  * @see        BaseObject::setDeleted()
  * @see        BaseObject::isDeleted()
  */
 public function delete($con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(UsersRolesPeer::DATABASE_NAME);
     }
     try {
         $con->begin();
         UsersRolesPeer::doDelete($this, $con);
         $this->setDeleted(true);
         $con->commit();
     } catch (PropelException $e) {
         $con->rollback();
         throw $e;
     }
 }
Example #2
0
 function deleteUserRole($ROL_UID, $USR_UID)
 {
     $crit = new Criteria();
     $crit->add(UsersRolesPeer::USR_UID, $USR_UID);
     if ($ROL_UID != '%') {
         $crit->add(UsersRolesPeer::ROL_UID, $ROL_UID);
     }
     UsersRolesPeer::doDelete($crit);
     $rol = $this->load($ROL_UID);
     $oUsersRbac = new RbacUsers();
     $user = $oUsersRbac->load($USR_UID);
     G::auditLog("DeleteUserToRole", "Delete user " . $user['USR_USERNAME'] . " (" . $USR_UID . ") to Role " . $rol['ROL_NAME'] . " (" . $ROL_UID . ") ");
 }
Example #3
0
 /**
  * remove a role from an user
  *
  * @access public
  * @param array $sUserUID
  * @return void
  */
 public function removeRolesFromUser($sUserUID = '')
 {
     $oCriteria = new Criteria('rbac');
     $oCriteria->add(UsersRolesPeer::USR_UID, $sUserUID);
     UsersRolesPeer::doDelete($oCriteria);
 }
Example #4
0
 function deleteUserRole($ROL_UID, $USR_UID)
 {
     $crit = new Criteria();
     $crit->add(UsersRolesPeer::USR_UID, $USR_UID);
     if ($ROL_UID != '%') {
         $crit->add(UsersRolesPeer::ROL_UID, $ROL_UID);
     }
     UsersRolesPeer::doDelete($crit);
 }