当前位置: 首页>>代码示例>>PHP>>正文


PHP Util::getPost方法代码示例

本文整理汇总了PHP中Util::getPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getPost方法的具体用法?PHP Util::getPost怎么用?PHP Util::getPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util的用法示例。


在下文中一共展示了Util::getPost方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$message = "";
if (!User::isLoggedIn()) {
    $app->render("login.html");
    die;
}
$info = User::getUserInfo();
if (!User::isModerator()) {
    $app->redirect("/");
}
if ($_POST) {
    $status = Util::getPost("status");
    $reply = Util::getPost("reply");
    $report = Util::getPost("report");
    $delete = Util::getPost("delete");
    $deleteapi = Util::getPost("deleteapi");
    $manualpull = Util::getPost("manualpull");
    if (isset($status)) {
        Db::execute("UPDATE zz_tickets SET status = :status WHERE id = :id", array(":status" => $status, ":id" => $id));
        if ($status == 0) {
            $app->redirect("..");
        }
    }
    if (isset($reply)) {
        $name = $info["username"];
        $moderator = $info["moderator"];
        $check = Db::query("SELECT * FROM zz_tickets_replies WHERE reply = :reply AND userid = :userid", array(":reply" => $reply, ":userid" => $info["id"]), 0);
        if (!$check) {
            Db::execute("INSERT INTO zz_tickets_replies (userid, belongsTo, name, reply, moderator) VALUES (:userid, :belongsTo, :name, :reply, :moderator)", array(":userid" => $info["id"], ":belongsTo" => $id, ":name" => $name, ":reply" => $reply, ":moderator" => $moderator));
            $tic = Db::query("SELECT name,email FROM zz_tickets WHERE id = :id", array(":id" => $id));
            $ticname = $tic[0]["name"];
            $ticmail = $tic[0]["email"];
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:moderator.php

示例2: array

 *
 * 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/>.
 */
$message = array();
$info = User::getUserInfo();
$ticket = Db::queryRow("SELECT * FROM zz_tickets WHERE id = :id", array(":id" => $id), 0);
if ($ticket == NULL or sizeof($ticket) == 0) {
    $message = array("status" => "error", "message" => "Ticket does not exist.");
} elseif ($ticket["status"] == 0) {
    $message = array("status" => "error", "message" => "Ticket has been closed, you cannot post, only view it");
} elseif ($ticket["userid"] != $info["id"] && $info["moderator"] == 0 && $info["admin"] == 0) {
    $app->notFound();
}
if ($_POST) {
    $reply = Util::getPost("reply");
    if ($reply && $ticket["status"] != 0) {
        $name = $info["username"];
        $moderator = $info["moderator"];
        $check = Db::query("SELECT * FROM zz_tickets_replies WHERE reply = :reply AND userid = :userid AND belongsTo = :id", array(":reply" => $reply, ":userid" => $info["id"], ":id" => $id), 0);
        if (!$check) {
            Db::execute("INSERT INTO zz_tickets_replies (userid, belongsTo, name, reply, moderator) VALUES (:userid, :belongsTo, :name, :reply, :moderator)", array(":userid" => $info["id"], ":belongsTo" => $id, ":name" => $name, ":reply" => $reply, ":moderator" => $moderator));
            global $baseAddr;
            if (!$moderator) {
                Log::ircAdmin("|g|Ticket response from {$name}:|n| https://{$baseAddr}/moderator/tickets/{$id}/");
            }
            $app->redirect("/tickets/view/{$id}/");
        }
    } else {
        $message = array("status" => "error", "message" => "No...");
    }
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:tickets_view.php

示例3:

            $entities[] = $entity;
            UserConfig::set("tracker_" . $entitymetadata['type'], $entities);
            $error = "{$entitymetadata['name']} has been added to your tracking list";
        } else {
            $error = "{$entitymetadata['name']} is already being tracked";
        }
    }
    $ddcombine = Util::getPost("ddcombine");
    if (isset($ddcombine)) {
        UserConfig::set("ddcombine", $ddcombine);
    }
    $ddmonthyear = Util::getPost("ddmonthYear");
    if (isset($ddmonthyear)) {
        UserConfig::set("ddmonthyear", $ddmonthyear);
    }
    $useSummaryAccordion = Util::getPost("useSummaryAccordion");
    if (isset($useSummaryAccordion)) {
        UserConfig::set("useSummaryAccordion", $useSummaryAccordion);
    }
}
$data["entities"] = Account::getUserTrackerData();
$data["themes"] = Util::bootstrapThemes();
$data["viewthemes"] = Util::themesAvailable();
$data["apiKeys"] = Api::getKeys($userID);
$data["apiChars"] = Api::getCharacters($userID);
$charKeys = Api::getCharacterKeys($userID);
$charKeys = Info::addInfo($charKeys);
$data["apiCharKeys"] = $charKeys;
$data["userInfo"] = User::getUserInfo();
$data["currentTheme"] = UserConfig::get("theme", "default");
$data["timeago"] = UserConfig::get("timeago");
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:account.php

示例4: array

<?php

if ($_POST) {
    $username = Util::getPost("username");
    $password = Util::getPost("password");
    $autologin = Util::getPost("autologin");
    $requesturi = Util::getPost("requesturi");
    if (!$username) {
        $error = "No username given";
        $app->render("login.html", array("error" => $error));
    } elseif (!$password) {
        $error = "No password given";
        $app->render("login.html", array("error" => $error));
    } elseif ($username && $password) {
        $check = User::checkLogin($username, $password);
        if ($check) {
            User::setLogin($username, $password, $autologin);
            $ignoreUris = array("/register/", "/login/", "/logout/");
            if (isset($requesturi) && !in_array($requesturi, $ignoreUris)) {
                $app->redirect($requesturi);
            } else {
                $app->redirect("/");
            }
        } else {
            $error = "No such user exists, try again";
            $app->render("login.html", array("error" => $error));
        }
    }
} else {
    $app->render("login.html");
}
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:login.php

示例5: array

<?php

if (User::isLoggedIn()) {
    $app->redirect('/', 302);
    die;
}
$referer = @$_SERVER['HTTP_REFERER'];
if ($_POST) {
    $username = Util::getPost('username');
    $password = Util::getPost('password');
    $autologin = Util::getPost('autologin');
    $requesturi = Util::getPost('requesturi');
    if (!$username) {
        $error = 'No username given';
        $app->render('login.html', array('error' => $error));
    } elseif (!$password) {
        $error = 'No password given';
        $app->render('login.html', array('error' => $error));
    } elseif ($username && $password) {
        $check = User::checkLogin($username, $password);
        if ($check) {
            // Success
            User::setLogin($username, $password, $autologin);
            $ignoreUris = array('/register/', '/login/', '/logout/');
            if (isset($requesturi) && !in_array($requesturi, $ignoreUris)) {
                $app->redirect($requesturi);
            } else {
                $app->redirect('/');
            }
        } else {
            $error = 'No such user exists, try again';
开发者ID:Nord001,项目名称:zKillboard,代码行数:31,代码来源:login.php

示例6: array

    Horde::authenticationFailureRedirect();
}
$rpc_servers = @unserialize($prefs->getValue('remote_summaries'));
if (!is_array($rpc_servers)) {
    $rpc_servers = array();
}
$actionID = Util::getFormData('actionID');
// Handle clients without javascript.
if (is_null($actionID)) {
    if (Util::getPost('edit')) {
        $actionID = RPC_EDIT;
    } elseif (Util::getPost('save')) {
        $actionID = RPC_SAVE;
    } elseif (Util::getPost('delete')) {
        $actionID = RPC_DELETE;
    } elseif (Util::getPost('back')) {
        _returnToPrefs();
    }
}
/* Run through the action handlers */
switch ($actionID) {
    case RPC_SAVE:
        if (($to_edit = Util::getFormData('edit_server')) == null) {
            $to_edit = count($rpc_servers);
            $rpc_servers[] = array();
        }
        $rpc_servers[$to_edit]['url'] = Util::getFormData('url');
        $rpc_servers[$to_edit]['user'] = Util::getFormData('user');
        $rpc_servers[$to_edit]['passwd'] = Util::getFormData('passwd');
        $prefs->setValue('remote_summaries', serialize($rpc_servers));
        $prefs->store();
开发者ID:Artea,项目名称:freebeer,代码行数:31,代码来源:rpcsum.php

示例7: array

 * it under the terms of the GNU Affero General Public License as 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/>.
 */
$message = array();
if ($_POST) {
    $tags = Util::getPost("hidden-tags");
    $ticket = Util::getPost("ticket");
    $info = User::getUserInfo();
    $name = $info["username"];
    $email = $info["email"];
    if (isset($name) && isset($email) && isset($tags) && isset($ticket)) {
        $check = Db::query("SELECT * FROM zz_tickets WHERE ticket = :ticket AND email = :email", array(":ticket" => $ticket, ":email" => $email), 0);
        if (!$check) {
            Db::execute("INSERT INTO zz_tickets (userid, name, email, tags, ticket) VALUES (:userid, :name, :email, :tags, :ticket)", array(":userid" => User::getUserID(), ":name" => $name, ":email" => $email, ":tags" => $tags, ":ticket" => $ticket));
            $id = Db::queryField("SELECT id FROM zz_tickets WHERE userid = :userid AND name = :name AND tags = :tags AND ticket = :ticket", "id", array(":userid" => User::getUserID(), ":name" => $name, ":tags" => $tags, ":ticket" => $ticket));
            global $baseAddr;
            Log::ircAdmin("|g|New ticket from {$name}:|n| https://{$baseAddr}/moderator/tickets/{$id}/");
            $subject = "zKillboard Ticket";
            $message = "{$name}, you can find your ticket here, we will reply to your ticket asap. https://{$baseAddr}/tickets/view/{$id}/";
            Email::send($email, $subject, $message);
            $app->redirect("/tickets/view/{$id}/");
        } else {
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:tickets.php

示例8: array

 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as 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/>.
 */
if ($_POST) {
    $email = Util::getPost("email");
    if (isset($email)) {
        $exists = Db::queryField("SELECT username FROM zz_users WHERE email = :email", "username", array(":email" => $email), 0);
        if ($exists != NULL) {
            $date = date("Y-m-d H:i:s", strtotime("+24 hours"));
            $hash = sha1($date . $email);
            $alreadySent = Db::queryField("SELECT change_hash FROM zz_users WHERE email = :email", "change_hash", array(":email" => $email), 0);
            if ($alreadySent != NULL) {
                $message = "A request to reset the password for this email, has already been sent";
                $messagetype = "error";
                $app->render("forgotpassword.html", array("message" => $message, "messagetype" => $messagetype));
            } else {
                global $baseAddr;
                $username = Db::queryField("SELECT username FROM zz_users WHERE email = :email", "username", array(":email" => $email));
                $subject = "It seems you might have forgotten your password, so here is a link, that'll allow you to reset it: {$baseAddr}/changepassword/{$hash}/ ps, your username is: {$username}";
                $header = "Password change for {$email}";
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:forgotpassword.php

示例9: array

$message = '';
if (!User::isLoggedIn()) {
    $app->render('login.html');
    die;
}
$info = User::getUserInfo();
if (!User::isModerator()) {
    $app->redirect('/');
}
if ($_POST) {
    $status = Util::getPost('status');
    $reply = Util::getPost('reply');
    $report = Util::getPost('report');
    $delete = Util::getPost('delete');
    $deleteapi = Util::getPost('deleteapi');
    $manualpull = Util::getPost('manualpull');
    if (isset($status)) {
        Db::execute('UPDATE zz_tickets SET status = :status WHERE id = :id', array(':status' => $status, ':id' => $id));
        if ($status == 0) {
            $app->redirect('..');
        }
    }
    if (isset($reply)) {
        $name = $info['username'];
        $moderator = $info['moderator'];
        $check = Db::query('SELECT * FROM zz_tickets_replies WHERE reply = :reply AND userid = :userid', array(':reply' => $reply, ':userid' => $info['id']), 0);
        if (!$check) {
            Db::execute('INSERT INTO zz_tickets_replies (userid, belongsTo, name, reply, moderator) VALUES (:userid, :belongsTo, :name, :reply, :moderator)', array(':userid' => $info['id'], ':belongsTo' => $id, ':name' => $name, ':reply' => $reply, ':moderator' => $moderator));
            $tic = Db::query('SELECT name,email FROM zz_tickets WHERE id = :id', array(':id' => $id));
            $ticname = $tic[0]['name'];
            $ticmail = $tic[0]['email'];
开发者ID:Nord001,项目名称:zKillboard,代码行数:31,代码来源:moderator.php

示例10: array

<?php

$message = array();
if ($_POST) {
    $tags = Util::getPost('hidden-tags');
    $ticket = Util::getPost('ticket');
    $info = User::getUserInfo();
    $name = $info['username'];
    $email = $info['email'];
    if (isset($name) && isset($email) && isset($tags) && isset($ticket)) {
        $check = Db::query('SELECT * FROM zz_tickets WHERE ticket = :ticket AND email = :email', array(':ticket' => $ticket, ':email' => $email), 0);
        if (!$check) {
            Db::execute('INSERT INTO zz_tickets (userid, name, email, tags, ticket) VALUES (:userid, :name, :email, :tags, :ticket)', array(':userid' => User::getUserID(), ':name' => $name, ':email' => $email, ':tags' => $tags, ':ticket' => $ticket));
            $id = Db::queryField('SELECT id FROM zz_tickets WHERE userid = :userid AND name = :name AND tags = :tags AND ticket = :ticket', 'id', array(':userid' => User::getUserID(), ':name' => $name, ':tags' => $tags, ':ticket' => $ticket));
            global $baseAddr;
            Log::irc("|g|New ticket from {$name}:|n| https://{$baseAddr}/moderator/tickets/{$id}/");
            $subject = 'zKillboard Ticket';
            $message = "{$name}, you can find your ticket here, we will reply to your ticket asap. https://{$baseAddr}/tickets/view/{$id}/";
            Email::send($email, $subject, $message);
            $app->redirect("/tickets/view/{$id}/");
        } else {
            $message = array('type' => 'error', 'message' => 'Ticket already posted');
        }
    } else {
        $message = array('type' => 'error', 'message' => 'Ticket was not posted, there was an error');
    }
}
$tickets = Db::query('SELECT * FROM zz_tickets WHERE userid = :userid ORDER BY datePosted DESC', array(':userid' => User::getUserID()), 0);
foreach ($tickets as $key => $val) {
    if ($val['tags']) {
        $tickets[$key]['tags'] = explode(',', $val['tags']);
开发者ID:Nord001,项目名称:zKillboard,代码行数:31,代码来源:tickets.php

示例11: array

 * 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/>.
 */
$involved = array();
$message = "";
if ($pageview == "comments") {
    $app->redirect("/detail/{$id}/#comment", 301);
}
$info = User::getUserInfo();
$name = $info["username"];
$userID = $info["id"];
$email = $info["email"];
if ($_POST) {
    $report = Util::getPost("report");
    if (isset($report)) {
        if ($id < 0) {
            $tags = "Reported Kill";
            Db::execute("INSERT INTO zz_tickets (userid, name, email, tags, ticket, killID) VALUES (:userid, :name, :email, :tags, :ticket, :killid)", array(":userid" => $userID, ":name" => $name, ":email" => $email, ":tags" => $tags, ":ticket" => $report, ":killid" => $id));
            global $baseAddr;
            $reportID = Db::queryField("SELECT id FROM zz_tickets WHERE killID = :killID AND name = :name", "id", array(":killID" => $id, ":name" => $name));
            Log::ircAdmin("Kill Reported by {$name}: https://{$baseAddr}/detail/{$id}/ - https://{$baseAddr}/moderator/reportedkills/{$reportID}/");
            $app->redirect("/detail/{$id}/");
        }
    }
}
if ($id < 0) {
    // See if this manual mail has an api verified version
    $mKillID = -1 * $id;
    $killID = Db::queryField("select killID from zz_manual_mails where mKillID = :mKillID", "killID", array(":mKillID" => $mKillID), 1);
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:detail.php

示例12: isset

<?php

$loggedIn = isset($_SESSION['loggedin']) ? $_SESSION['loggedin'] : false;
if (!empty($loggedIn)) {
    $app->render('dlogin.html', array('close' => true));
}
if ($_POST) {
    $username = Util::getPost('username');
    $password = Util::getPost('password');
    $autologin = Util::getPost('autologin');
    if (!$username) {
        $error = 'No username given';
        $app->render('dlogin.html', array('error' => $error));
    } elseif (!$password) {
        $error = 'No password given';
        $app->render('dlogin.html', array('error' => $error));
    } elseif ($username && $password) {
        $check = User::checkLogin($username, $password);
        if ($check) {
            // Success
            $bool = User::setLogin($username, $password, $autologin);
            $app->render('dlogin.html', array('close' => $bool));
        } else {
            $error = 'No such user exists, try again';
            $app->render('dlogin.html', array('error' => $error));
        }
    }
} else {
    $app->render('dlogin.html');
}
开发者ID:Nord001,项目名称:zKillboard,代码行数:30,代码来源:dlogin.php

示例13: sha1

<?php

global $cookie_secret;
$randomString = sha1(time());
// Check if user is already merged, just to be safe
$exists = Db::queryField('SELECT merged FROM zz_users WHERE characterID = :characterID', 'merged', array(':characterID' => $characterID), 0);
if ($exists == 1) {
    $error = 'Error: User already merged.';
    $app->render('merge.html', array('error' => $error, 'characterID' => $characterID, 'randomString' => $randomString));
}
// Otherwise show the page..
if ($_POST) {
    $username = Util::getPost('username');
    $password = Util::getPost('password');
    if (!$username) {
        $error = 'No username given';
        $app->render('merge.html', array('error' => $error, 'characterID' => $characterID, 'randomString' => $randomString));
    } elseif (!$password) {
        $error = 'No password given';
        $app->render('merge.html', array('error' => $error, 'characterID' => $characterID, 'randomString' => $randomString));
    } elseif ($username && $password) {
        $check = User::checkLogin($username, $password);
        if ($check) {
            // Success
            // Get userID for user that passes
            $userID = Db::queryField('SELECT id FROM zz_users WHERE username = :username', 'id', array(':username' => $username));
            // Update userID in zz_crest_users
            Db::execute('UPDATE zz_users_crest SET userID = :userID WHERE characterID = :characterID', array(':userID' => $userID, ':characterID' => $characterID));
            // Update the characterID on zz_users and set merged to 1
            Db::execute('UPDATE zz_users SET merged = 1 WHERE id = :userID', array(':userID' => $userID));
            Db::execute('UPDATE zz_users SET characterID = :characterID WHERE id = :userID', array(':userID' => $userID, ':characterID' => $characterID));
开发者ID:Nord001,项目名称:zKillboard,代码行数:31,代码来源:merge.php

示例14: elseif

<?php

$password = Util::getPost('password');
$password2 = Util::getPost('password2');
if ($password && $password2) {
    $message = '';
    $messagetype = '';
    $password = Util::getPost('password');
    $password2 = Util::getPost('password2');
    if (!$password || !$password2) {
        $message = 'Password missing, try again..';
        $messagetype = 'error';
    } elseif ($password != $password2) {
        $message = 'Password mismatch, try again..';
        $messagetype = 'error';
    } elseif ($password == $password2) {
        $password = Password::genPassword($password);
        Db::execute('UPDATE zz_users SET password = :password WHERE change_hash = :hash', array(':password' => $password, ':hash' => $hash));
        Db::execute('UPDATE zz_users SET change_hash = NULL, change_expiration = NULL WHERE change_hash = :hash', array(':hash' => $hash));
        $message = 'Password updated, click login, and login with your new password';
        $messagetype = 'success';
    }
    $app->render('changepassword.html', array('message' => $message, 'messagetype' => $messagetype));
} else {
    $date = date('Y-m-d H:i:s');
    $allowed = Db::queryField('SELECT change_expiration FROM zz_users WHERE change_hash = :hash', 'change_expiration', array(':hash' => $hash));
    if (isset($allowed) && $allowed > $date) {
        $foruser = Db::queryField('SELECT email FROM zz_users WHERE change_hash = :hash', 'email', array(':hash' => $hash));
        $app->render('changepassword.html', array('email' => $foruser, 'hash' => $hash));
    } else {
        $message = "Either your password change hash doesn't exist, or it has expired";
开发者ID:Nord001,项目名称:zKillboard,代码行数:31,代码来源:changepassword.php

示例15: elseif

 * 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/>.
 */
if ($_POST) {
    $message = "";
    $messagetype = "";
    $password = Util::getPost("password");
    $password2 = Util::getPost("password2");
    if (!$password || !$password2) {
        $message = "Password missing, try again..";
        $messagetype = "error";
    } elseif ($password != $password2) {
        $message = "Password mismatch, try again..";
        $messagetype = "error";
    } elseif ($password == $password2) {
        $password = Password::genPassword($password);
        Db::execute("UPDATE zz_users SET password = :password WHERE change_hash = :hash", array(":password" => $password, ":hash" => $hash));
        Db::execute("UPDATE zz_users SET change_hash = NULL, change_expiration = NULL WHERE change_hash = :hash", array(":hash" => $hash));
        $message = "Password updated, click login, and login with your new password";
        $messagetype = "success";
    }
    $app->render("changepassword.html", array("message" => $message, "messagetype" => $messagetype));
} else {
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:31,代码来源:changepassword.php


注:本文中的Util::getPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。