PHP User::getIsAdmin Examples

PHP User::getIsAdmin - 2 examples found. These are the top rated real world PHP examples of User::getIsAdmin extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 /**
  * Returns a new {@link ClockingQuery} instance.
  *
  * The query will automatically populate the related {@link ClockingType},
  * {@link User} and {@link Domain} objects and will join on the "transaction"
  * table without fetching its records.
  *
  * @return ClockingQuery
  */
 public static function createClockingQuery(User $authUser, PropelPDO $con = null)
 {
     $account = $authUser->getAccount($con);
     if ($account === null) {
         throw new Exception('Could not determine company account for user "' . $authUser->getName() . '" #' . $authUser->getId() . '.');
     }
     $query = ClockingQuery::create()->setDistinct()->joinWith('ClockingType')->joinWith('UserRelatedByUserId')->joinWith('UserRelatedByUserId.Domain')->leftJoinTransactionClocking()->leftJoin('TransactionClocking.Transaction')->addJoinCondition('Transaction', 'Transaction.Deleted=0')->add(UserPeer::DELETED, 0)->add(DomainPeer::VALID, null, Criteria::NOT_EQUAL)->add(DomainPeer::ACCOUNT_ID, $account->getId())->withColumn('(TransactionClocking.ClockingId IS NOT NULL AND (Transaction.Deleted=0 AND Transaction.Id IS NOT NULL))', 'Booked');
     if (!$authUser->getIsAdmin()) {
         $authUserId = $authUser->getId();
         $query->add($query->getNewCriterion(ClockingPeer::CREATOR_ID, $authUserId)->addOr($query->getNewCriterion(ClockingPeer::USER_ID, $authUserId)));
     }
     return $query;
 }
        if (Login::verify_user($q_usuario, $q_password)) {
            // bien
        } else {
            User::SignOff();
            mensaje("Error en dato de usuario y/o contraseña", "", "error");
            redireccionar("index.php");
        }
    } else {
        //pido usuario y contraseña para el ingreso
        User::Login();
    }
}
if (User::getLoginSession()) {
    echo "\n    <ul style=\"margin:19px 0 18px 0;\" class=\"nav nav-tabs test2\">\n        <li class=\"active\"><a data-toggle=\"tab\" href=\"#exportacion\">Exportación de datos de sondas</a></li>\n        <li><a data-toggle=\"tab\" href=\"#detenidas\">Informe de detenidas</a></li>\n    </ul>";
    User::logged(User::getIsAdmin());
    if (User::getIsAdmin()) {
        // para administradores
        if (isset($_POST['alta_usuario'])) {
            //inserto usuario nuevo
            if (User::save()) {
                mensaje("Se guard\\u00F3 el nuevo usuario", "Nuevo usuario");
            } else {
                mensaje("ERROR! No se pudo guardar el usuario", "", "error");
            }
        }
        if (isset($_POST['confirmed_delete_user'])) {
            $userid = req("confirmed_delete_user");
            if (User::delete_user($userid)) {
                mensaje("El usuario fue borrado", "Borrar usuario");
            } else {
                mensaje("ERROR! No se pudo borrar el usuario", "", "error");