本文整理汇总了PHP中mkglobal函数的典型用法代码示例。如果您正苦于以下问题:PHP mkglobal函数的具体用法?PHP mkglobal怎么用?PHP mkglobal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mkglobal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bark
// | |
// | You should have received a copy of the GNU General Public License |
// | along with TBDevYSE; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
require_once "include/bittorrent.php";
function bark($msg)
{
stderr("Произошла ошибка", $msg);
}
dbconn();
loggedinorreturn();
if (!mkglobal("email:oldpassword:chpassword:passagain")) {
bark("missing form data");
}
// $set = array();
$updateset = array();
$changedemail = 0;
if ($chpassword != "") {
if (strlen($chpassword) > 40) {
bark("Извините, ваш пароль слишком длинный (максимум 40 символов)");
}
if ($chpassword != $passagain) {
bark("Пароли не совпадают. Попробуйте еще раз.");
}
if ($CURUSER["passhash"] != md5($CURUSER["secret"] . $oldpassword . $CURUSER["secret"])) {
bark("Вы ввели неправильный старый пароль.");
}
示例2: define
/**
*
* @Author Neptune
* @Credits All credit to Retro for the great idea of his updated modtask.php
* @Project TBDev.net
* @Category Addon Mods
* @Date Monday, Jan 5, 2009
*/
require 'include/bittorrent.php';
require 'include/bbcode_functions.php';
require 'include/user_functions.php';
define('MIN_CLASS', UC_MODERATOR);
define('NFO_SIZE', 65535);
$possible_extensions = array('nfo', 'txt');
if (!mkglobal('id:name:descr:type')) {
die;
}
$id = 0 + $id;
if (!is_valid_id($id)) {
stderr('Error', 'Invalid ID!');
}
dbconn();
maxcoder();
if (!logged_in()) {
header("HTTP/1.0 404 Not Found");
// moddifed logginorreturn by retro//Remember to change the following line to match your server
print "<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 " . $SITENAME . " Server at " . $_SERVER['SERVER_NAME'] . " Port 80</address></body></html>\n";
die;
}
/**
示例3: stderr
}
if ($type == "signup" && mkglobal("email")) {
if (!validemail($email)) {
stderr($tracker_lang['error'], "Это не похоже на реальный email адрес.");
}
stdhead($tracker_lang['signup_successful']);
stdmsg($tracker_lang['signup_successful'], $use_email_act ? sprintf($tracker_lang['confirmation_mail_sent'], htmlspecialchars_uni($email)) : sprintf($tracker_lang['thanks_for_registering'], $SITENAME));
stdfoot();
} elseif ($type == "sysop") {
stdhead($tracker_lang['sysop_activated']);
if (isset($CURUSER)) {
stdmsg($tracker_lang['sysop_activated'], sprintf($tracker_lang['sysop_account_activated'], $DEFAULTBASEURL));
} else {
print "<p>Your account has been activated! However, it appears that you could not be logged in automatically. A possible reason is that you disabled cookies in your browser. You have to enable cookies to use your account. Please do that and then <a href=\"login.php\">log in</a> and try again.</p>\n";
}
mkglobal('email');
stdfoot();
} elseif ($type == "confirmed") {
stdhead($tracker_lang['account_activated']);
stdmsg($tracker_lang['account_activated'], $tracker_lang['this_account_activated']);
stdfoot();
} elseif ($type == "confirm") {
if (isset($CURUSER)) {
stdhead("Подтверждение регистрации");
print "<h1>Ваш аккаунт успешно подтвержден!</h1>\n";
print "<p>Ваш аккаунт теперь активирован! Вы автоматически вошли. Теперь вы можете <a href=\"{$DEFAULTBASEURL}/\"><b>перейти на главную</b></a> и начать использовать ваш аккаунт.</p>\n";
print "<p>Прежде чем начать использовать {$SITENAME} мы рекомендуем вам прочитать <a href=\"rules.php\"><b>правила</b></a> и <a href=\"faq.php\"><b>ЧаВо</b></a>.</p>\n";
stdfoot();
} else {
stdhead("Signup confirmation");
print "<h1>Account successfully confirmed!</h1>\n";
示例4: dirname
/**
* https://github.com/Bigjoos/
* Licence Info: GPL
* Copyright (C) 2010 U-232 v.3
* A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
* Project Leaders: Mindless, putyn.
*
*/
//==bookmark.php - by pdq
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php';
require_once INCL_DIR . 'user_functions.php';
dbconn();
loggedinorreturn();
$lang = array_merge(load_language('global'));
$HTMLOUT = '';
if (!mkglobal("torrent")) {
stderr("Error", "missing form data");
}
$userid = (int) $CURUSER['id'];
if (!is_valid_id($userid)) {
stderr("Error", "Invalid ID.");
}
if ($userid != $CURUSER["id"]) {
stderr("Error", "Access denied.");
}
$torrentid = 0 + $_GET["torrent"];
if (!is_valid_id($torrentid)) {
die;
}
if (!isset($torrentid)) {
stderr("Error", "Failed. No torrent selected");
示例5: urlencode
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
require_once __DIR__ . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php';
require_once INCL_DIR . 'user_functions.php';
require_once INCL_DIR . 'html_functions.php';
require_once INCL_DIR . 'bbcode_functions.php';
require_once CLASS_DIR . 'page_verify.php';
global $CURUSER;
if (!mkglobal("id")) {
die;
}
$id = 0 + $id;
if (!$id) {
die;
}
/** who is modding by pdq **/
if (isset($_GET['unedit']) && $_GET['unedit'] == 1 && $CURUSER['class'] >= UC_STAFF) {
$returl = "details.php?id={$id}";
if (isset($_POST["returnto"])) {
$returl .= "&returnto=" . urlencode($_POST["returnto"]);
}
header("Refresh: 1; url={$returl}");
$mc1->delete_value('editedby_' . $id);
exit;
示例6: header
$HTMLOUT = '';
$HTMLOUT .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r\n\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\t\t<html xmlns='http://www.w3.org/1999/xhtml'>\r\n\t\t<head>\r\n\t\t<title>Error!</title>\r\n\t\t</head>\r\n\t\t<body>\r\n\t<div style='font-size:33px;color:white;background-color:red;text-align:center;'>Incorrect access<br />You cannot access this file directly.</div>\r\n\t</body></html>";
print $HTMLOUT;
exit;
}
require_once INCL_DIR . 'user_functions.php';
require_once INCL_DIR . 'html_functions.php';
if (!min_class(UC_ADMINISTRATOR)) {
// or just simply: if (!min_class(UC_STAFF))
header("Location: {$TBDEV['baseurl']}/index.php");
}
$lang = array_merge($lang);
$select = '';
$HTMLOUT = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
mkglobal("subforum:descr:place:minclassread:minclasswrite:minclasscreate");
if (empty($subforum) || empty($descr) || empty($place)) {
stderr("Err", "You missed something !");
} else {
mysql_query("INSERT INTO forums(`name`,`description` ,`minclassread` ,`minclasswrite` ,`minclasscreate`,`place`,`forid`) VALUES(" . join(",", array_map("sqlesc", array($subforum, $descr, $minclassread, $minclasswrite, $minclasscreate, $place, $place))) . ")") or sqlerr(__FILE__, __LINE__);
if (mysql_insert_id()) {
header('Refresh: 3; url=' . $TBDEV['baseurl'] . '/admin.php?action=msubforums');
stderr("Success", "Forum added");
} else {
header('Refresh: 2; url=' . $TBDEV['baseurl'] . '/admin.php?action=msubforums');
}
stderr("Err", "Something was wrong");
}
} else {
$HTMLOUT .= begin_frame();
//== First build the list with all the subforums
示例7: require_once
<?
require_once("include/bittorrent.php");
hit_start();
dbconn();
hit_count();
if (!mkglobal("type"))
die();
if ($type == "signup" && mkglobal("email")) {
stdhead("Skráning notanda");
stdmsg("Skráning tókst!",
"Það hefur verið sendur póstur á netfangið sem þú skráðir, fylgið hlekknum sem þar er til að virkja aðganginn.");
stdfoot();
}
elseif ($type == "confirmed") {
stdhead("Aðgangur nú þegar virkur");
print("<h1>Aðgangur nú þegar virkur</h1>\n");
print("<p>Þessi aðgangur hefur nú þegar verið virkur, þú getur skráð þig inn á <a href=\"login.php\">innskráningarsíðunni</a></p>\n");
stdfoot();
}
elseif ($type == "confirm") {
if (isset($CURUSER)) {
stdhead("Virkjun aðgangs");
print("<h1>Virkjun á aðgangi þínum tókst!</h1>\n");
print("<p>Aðgangur þinn hefur verið gerður virkur! Þú varst skráður inn sjálfkrafa. Þú getur nú farið á <a href=\"/\"><b>aðalsíðuna</b></a> og byrjað að nota aðganginn þinn.</p>\n");
print("<p>Áður en þú notar Istorrent ber þér skylda að lesa <a href=\"rules.php\"><b>reglurnar</b></a> og <a href=\"faq.php\"><b>SOS</b></a>.</p>\n");
示例8: conn
<?php
require_once './config.php';
require_once './class/conn.class.php';
include './include/function.php';
$con = new conn();
if (!mkglobal('user:password:openid')) {
exit(json_encode(array('status' => 'fail', 'errmsg' => '非法操作')));
}
$sql = "SELECT * FROM `weixin` WHERE `openid` = '{$openid}'";
$result = $con->query($sql);
if (!empty($result)) {
exit(json_encode(array('status' => 'fail', 'errmsg' => '已绑定账户!')));
}
$sql = "SELECT * FROM `users` WHERE `username` = '{$user}' ";
$result = $con->query($sql);
if ($result != NULL) {
$rs = $result[0];
if ($rs['status'] == 'pending') {
echo json_encode(array('status' => 'fail', 'errmsg' => '账户未激活'));
exit;
}
if ($rs['passhash'] != md5($rs['secret'] . $password . $rs['secret'])) {
var_dump($rs);
echo md5($rs['secret'] . $password . $rs['secret']);
echo json_encode(array('status' => 'fail', 'errmsg' => '密码错误!'));
exit;
}
$sql = "INSERT INTO `weixin` (`ptid` , `openid` ) VALUES ('{$rs['id']}','{$openid}')";
if ($con->query($sql)) {
echo json_encode(array('status' => 'success', 'errmsg' => '成功!'));
示例9: array_merge
$lang = array_merge(load_language('global'), load_language('takelogin'));
// 09 failed logins thanks to pdq - Retro
function failedloginscheck()
{
global $INSTALLER09;
$total = 0;
$ip = getip();
$res = sql_query("SELECT SUM(attempts) FROM failedlogins WHERE ip=" . sqlesc($ip)) or sqlerr(__FILE__, __LINE__);
list($total) = mysqli_fetch_row($res);
if ($total >= $INSTALLER09['failedlogins']) {
sql_query("UPDATE failedlogins SET banned = 'yes' WHERE ip=" . sqlesc($ip)) or sqlerr(__FILE__, __LINE__);
stderr("Login Locked!", "You have been <b>Exceeded</b> the allowed maximum login attempts without successful login, therefore your ip address <b>(" . htmlsafechars($ip) . ")</b> has been locked for 24 hours.");
}
}
// End
if (!mkglobal('username:password' . ($INSTALLER09['captcha_on'] ? ":captchaSelection:" : ":") . 'submitme')) {
die('Something went wrong');
}
if ($submitme != 'X') {
stderr('Ha Ha', 'You Missed, You plonker !');
}
if ($INSTALLER09['captcha_on'] && !$gotkey) {
if (empty($captchaSelection) || $_SESSION['simpleCaptchaAnswer'] != $captchaSelection) {
header('Location: login.php');
exit;
}
}
function bark($text = 'Username or password incorrect')
{
global $lang, $INSTALLER09, $mc1;
$sha = sha1($_SERVER['REMOTE_ADDR']);
示例10: bark
| =============================================
| by CoLdFuSiOn
| (c) 2003 - 2009 TBDev.Net
| http://www.tbdev.net
| =============================================
| svn: http://sourceforge.net/projects/tbdevnet/
| Licence Info: GPL
+------------------------------------------------
| $Date$
| $Revision$
| $Author$
| $URL$
+------------------------------------------------
*/
require_once 'include/bittorrent.php';
if (!mkglobal('username:password:captcha')) {
die;
}
session_start();
if (empty($captcha) || $_SESSION['captcha_id'] != strtoupper($captcha)) {
header('Location: login.php');
exit;
}
dbconn();
$lang = array_merge(load_language('global'), load_language('takelogin'));
function bark($text = 'Username or password incorrect')
{
global $lang;
stderr($lang['tlogin_failed'], $text);
}
$res = mysql_query("SELECT id, passhash, secret, enabled FROM users WHERE username = " . sqlesc($username) . " AND status = 'confirmed'");
示例11: failedloginscheck
//== 09 failed logins thanks to pdq - Retro
function failedloginscheck()
{
global $INSTALLER09;
$total = 0;
$ip = sqlesc(getip());
$res = sql_query("SELECT SUM(attempts) FROM failedlogins WHERE ip={$ip}") or sqlerr(__FILE__, __LINE__);
list($total) = mysql_fetch_row($res);
if ($total >= $INSTALLER09['failedlogins']) {
mysql_query("UPDATE failedlogins SET banned = 'yes' WHERE ip={$ip}") or sqlerr(__FILE__, __LINE__);
stderr("Login Locked!", "You have been <b>Exceeded</b> the allowed maximum login attempts without successful login, therefore your ip address <b>(" . htmlspecialchars($ip) . ")</b> has been locked for 24 hours.");
}
}
//==End
failedloginscheck();
if (!mkglobal("qlogin") || strlen($qlogin = htmlspecialchars($qlogin)) != 96) {
die(n00b);
}
function bark($text = "<b>Oops</b>: Theres been an error - w00t!")
{
stderr("Error", $text);
}
$hash1 = substr($qlogin, 0, 32);
$hash2 = substr($qlogin, 32, 32);
$hash3 = substr($qlogin, 64, 32);
$hash1 .= $hash2 . $hash3;
$res = sql_query("SELECT id, username, passhash, enabled FROM users WHERE hash1 = " . sqlesc($hash1) . " AND class >= " . UC_MODERATOR . " AND status = 'confirmed' LIMIT 1");
$row = mysql_fetch_assoc($res);
if (!$row) {
$ip = sqlesc(getip());
$added = sqlesc(time());
示例12: dbconn
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
require_once 'include/bittorrent.php';
dbconn();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($use_captcha) {
$b = get_row_count('captcha', 'WHERE imagehash = ' . sqlesc($_POST['imagehash']) . ' AND imagestring = ' . sqlesc($_POST['imagestring']));
sql_query('DELETE FROM captcha WHERE imagehash = ' . sqlesc($_POST['imagehash'])) or die(mysql_error());
if ($b == 0) {
stderr($tracker_lang['error'], 'Вы ввели неправильный код подтверждения.');
}
}
if (!mkglobal('useremail:subject:message')) {
stderr($tracker_lang['error'], 'Вы не заполнили все поля формы! Вернитесь назад и попробуйте еще раз.');
}
if (!validemail($useremail)) {
stderr($tracker_lang['error'], 'Это не похоже на реальный email адрес.');
}
$ip = getip();
$username = $CURUSER['username'] ? $CURUSER['username'] : 'unregged';
if ($CURUSER) {
$userid = $CURUSER['id'];
} else {
$userid = 0;
}
$body = <<<EOD
Сообщение через обратную связь на {$website_name}:
示例13: failedloginscheck
//== 09 failed logins thanks to pdq - Retro
function failedloginscheck()
{
global $INSTALLER09;
$total = 0;
$ip = getip();
$res = sql_query("SELECT SUM(attempts) FROM failedlogins WHERE ip=" . sqlesc($ip)) or sqlerr(__FILE__, __LINE__);
list($total) = mysqli_fetch_row($res);
if ($total >= $INSTALLER09['failedlogins']) {
sql_query("UPDATE failedlogins SET banned = 'yes' WHERE ip=" . sqlesc($ip)) or sqlerr(__FILE__, __LINE__);
stderr("Login Locked!", "You have <b>Exceeded</b> the allowed maximum login attempts without successful login, therefore your ip address <b>(" . htmlsafechars($ip) . ")</b> has been locked out for 24 hours.");
}
}
//==End
failedloginscheck();
if (!mkglobal("qlogin") || strlen($qlogin = $qlogin) != 96) {
die(n00b);
}
function bark($text = 'Username or password incorrect')
{
global $lang, $INSTALLER09, $mc1;
$sha = sha1($_SERVER['REMOTE_ADDR']);
$dict_key = 'dictbreaker:::' . $sha;
$flood = $mc1->get_value($dict_key);
if ($flood === false) {
$mc1->cache_value($dict_key, 'flood_check', 20);
} else {
die('Minimum 8 seconds between login attempts :)');
}
stderr($lang['tlogin_failed'], $text);
}
示例14: dbconn
*/
require_once __DIR__ . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php';
require_once INCL_DIR . 'user_functions.php';
require_once INCL_DIR . 'password_functions.php';
dbconn();
// Begin the session
ini_set('session.use_trans_sid', '0');
session_start();
global $CURUSER;
if (!$CURUSER) {
get_template();
}
$lang = array_merge(load_language('global'), load_language('recover'));
$stdhead = array('js' => array('jquery', 'jquery.simpleCaptcha-0.2'));
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!mkglobal('email' . ($INSTALLER09['captcha_on'] ? ":captchaSelection" : "") . '')) {
stderr("Oops", "Missing form data - You must fill all fields");
}
if ($INSTALLER09['captcha_on']) {
if (empty($captchaSelection) || $_SESSION['simpleCaptchaAnswer'] != $captchaSelection) {
header('Location: recover.php');
exit;
}
}
$email = trim($_POST["email"]);
if (!validemail($email)) {
stderr("{$lang['stderr_errorhead']}", "{$lang['stderr_invalidemail']}");
}
$res = sql_query("SELECT * FROM users WHERE email=" . sqlesc($email) . " LIMIT 1") or sqlerr(__FILE__, __LINE__);
$arr = mysqli_fetch_assoc($res) or stderr("{$lang['stderr_errorhead']}", "{$lang['stderr_notfound']}");
$sec = mksecret();
示例15: dirname
* @Date Monday, Aug 2, 2010
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'bittorrent.php';
require_once INCL_DIR . 'user_functions.php';
require_once CLASS_DIR . 'page_verify.php';
require_once INCL_DIR . 'function_memcache.php';
define('MIN_CLASS', UC_STAFF);
define('NFO_SIZE', 65535);
dbconn();
loggedinorreturn();
$lang = array_merge(load_language('global'), load_language('takeedit'));
$newpage = new page_verify();
$newpage->check('teit');
$torrent_cache = $torrent_txt_cache = '';
$possible_extensions = array('nfo', 'txt');
if (!mkglobal('id:name:body:type')) {
die('Id,descr,name or type missing');
}
$id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
if (!is_valid_id($id)) {
stderr($lang['takedit_failed'], $lang['takedit_no_data']);
}
/**
*
* @Function valid_torrent_name
* @Notes only safe characters are allowed..
* @Begin
*/
function valid_torrent_name($torrent_name)
{
$allowedchars = 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_[]*()';