コード例 #1
0
ファイル: Test.class.php プロジェクト: agldiego/salud
 function prueba()
 {
     global $db;
     $odbconn = MDB2::connect($db['dsn'], $db['opts']);
     print_r($odbconn);
     if (PEAR::isError($odbconn)) {
         die(${$odbconn}->getMessage());
     }
     if (!$modo) {
         $odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
     }
     $query = "SELECT 1";
     $rst = $odbconn->queryRow($sql);
     $odbconn->disconnect();
     if (PEAR::isError($rst)) {
         $debug = debug_backtrace();
         print_r($debug);
         infoMessage('Error Cr&iacute;tico en la aplicaci&oacute;n', "<b>Error::</b>: Select Query Problem: " . $sql . $rst->getMessage(), '90%', 1);
         return false;
     }
     var_dump($rst);
 }
コード例 #2
0
ファイル: grantla.php プロジェクト: dg-wfk/dl
    // purge immediately
    foreach ($sel as $id) {
        if (!isGrantId($id)) {
            continue;
        }
        $sql = "SELECT * FROM \"grant\" WHERE id = " . $db->quote($id);
        $DATA = $db->query($sql)->fetch();
        if ($DATA === false) {
            continue;
        }
        // actually purge the grant
        $list[] = htmlEntUTF8(grantStr($DATA));
        grantPurge($DATA, false);
    }
    if (count($list)) {
        infoMessage(T_("Purged"), $list);
    }
}
// list active grants
$sql = 'SELECT g.*, u.name AS "user" FROM "grant" g' . ' LEFT JOIN "user" u ON u.id = g.user_id' . ' ORDER BY time DESC';
?>
<form action="<?php 
echo $ref;
?>
" method="post">
  <table class="sortable" id="allgrants">
    <thead>
      <tr>
        <th><input class="element checkbox" type="checkbox" onclick="selectAll(this.checked);"/></th>
        <th></th>
        <th></th>
コード例 #3
0
function centeredInfoMessage($brBefore, $brAfter, $message)
{
    infoMessage($brBefore, $brAfter, "<center>" . $message . "</center>");
}
コード例 #4
0
ファイル: prefs.php プロジェクト: dg-wfk/dl
  </ul>
</form>
<?php 
// password update
if (!$authRealm) {
    // password update
    if (isset($_POST['changepw']) && !empty($_POST['oldpw']) && !empty($_POST['newpw']) && !empty($_POST['newpw2'])) {
        // create user
        if ($_POST['newpw'] !== $_POST['newpw2']) {
            errorMessage(T_("Password change"), T_("New passwords don't match! Password unchanged."));
        } elseif (!userCheck($auth['name'], $_POST['oldpw'])) {
            errorMessage(T_("Password change"), T_("Old password doesn't match! Password unchanged."));
        } else {
            userUpd($auth['name'], $_POST['newpw']);
            infoMessage(T_("Password change"), T_("Password successfully changed."));
        }
    }
    ?>
<form action="<?php 
    echo $ref;
    ?>
" method="post" onsubmit="validate(event);">
  <ul>
    <h3><?php 
    echo T_("Password");
    ?>
</h3>

    <li>
      <?php 
コード例 #5
0
ファイル: users.php プロジェクト: dg-wfk/dl
    if (userAdd($user, $pass, $admin)) {
        infoMessage(T_("Created"), htmlEntUTF8($user));
    } else {
        errorMessage(T_("Creation failed"), sprintf(T_("user \"%s\" already exists"), htmlEntUTF8($user)));
    }
}
if (isset($_POST["delete"]) && !empty($_POST["sel"])) {
    $list = array();
    // delete users
    foreach ($_POST["sel"] as $name) {
        if (userDel($name)) {
            $list[] = htmlEntUTF8($name);
        }
    }
    if (count($list)) {
        infoMessage(T_("Deleted"), $list);
    }
}
if (isset($_POST['apply']) && !empty($_POST['user']) && is_array($_POST['user']) && !empty($_POST['role']) && is_array($_POST['role']) && !empty($_POST['pass']) && is_array($_POST['pass']) && count($_POST['user']) == count($_POST['role']) && count($_POST['role']) == count($_POST['pass'])) {
    $user = $_POST['user'];
    $role = $_POST['role'];
    $pass = $_POST['pass'];
    $list = array();
    for ($i = 0; $i != count($user); ++$i) {
        $o = userAdm($user[$i]);
        if (is_null($o)) {
            continue;
        }
        $role[$i] = $role[$i] == 1;
        $sameRole = $o == $role[$i];
        $samePass = empty($pass[$i]);
コード例 #6
0
<?php

/*
** Fichier : changenavigation
** Date de creation : 27/12/2004
** Auteurs : Conde Mickael, Badaoui Kassem, Canaye Kurvin, Guenatri Kamil
** Version : 1.0
** Description : Fichier inclu permettant la modification du mode de navigation sur le site principal
*/
// !!! on s'assure que cette page est appelee a partir de admin.php
if (is_numeric(strpos($_SERVER['PHP_SELF'], "admin.php"))) {
    // si on doit basculer en mode normal
    if (isset($_SESSION['rootNavigation'])) {
        unset($_SESSION['rootNavigation']);
    } else {
        $_SESSION['rootNavigation'] = true;
    }
    infoMessage(3, 3, "Mode de navigation chang&eacute;...");
    print "<meta http-equiv=\"refresh\" content=\"0;url=admin.php\">\n";
} else {
    print "<br><br><br><center><u>Impossible d'utiliser cette page directement</u></center>";
}
/*
** EOF changenavigation
*/
コード例 #7
0
ファイル: Util.class.php プロジェクト: agldiego/sitio
 function queryAll($sql, $modo = null)
 {
     global $db;
     $odbconn = MDB2::connect($db['dsn'], $db['opts']);
     if (!$modo) {
         $odbconn->setFetchMode(MDB2_FETCHMODE_ASSOC);
     }
     $rst = $odbconn->queryAll($sql);
     $odbconn->disconnect();
     if (PEAR::isError($rst)) {
         $debug = debug_backtrace();
         print_r($debug);
         infoMessage('Error Cr&iacute;tico en la aplicaci&oacute;n', "<b>Error::</b>: Select Query Problem: " . $sql . $rst->getMessage(), '90%', 1);
         return false;
     }
     return $rst;
 }
コード例 #8
0
<?php

/*
** Fichier : logout
** Date de creation : 30/11/2004
** Auteurs : Conde Mickael, Badaoui Kassem, Canaye Kurvin, Guenatri Kamil
** Version : 1.0
** Description : Fichier inclu permettant la fermeture de session
*/
// rien de critique dans ce fichier
session_destroy();
// redirection
infoMessage(3, 3, "Fermeture de session...");
print "<meta http-equiv=\"refresh\" content=\"0;url=admin.php\">\n";
/*
** EOF logout
*/