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


PHP preg_check函数代码示例

本文整理汇总了PHP中preg_check函数的典型用法代码示例。如果您正苦于以下问题:PHP preg_check函数的具体用法?PHP preg_check怎么用?PHP preg_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: valid_session

function valid_session($id)
{
    if (preg_check("/^[0-9a-z]+\$/", $id)) {
        return $id;
    } else {
        return "";
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:8,代码来源:session_include.php

示例2: verifyCode

 public function verifyCode($value)
 {
     global $locale, $userdata;
     if (!preg_check("/^[0-9a-z]{32}\$/i", $value)) {
         redirect("index.php");
     }
     $result = dbquery("SELECT * FROM " . DB_EMAIL_VERIFY . " WHERE user_code='" . $value . "'");
     if (dbrows($result)) {
         $data = dbarray($result);
         if ($data['user_id'] == $userdata['user_id']) {
             if ($data['user_email'] != $userdata['user_email']) {
                 $result = dbquery("SELECT user_email FROM " . DB_USERS . " WHERE user_email='" . $data['user_email'] . "'");
                 if (dbrows($result) > 0) {
                     addNotice("danger", $locale['u164'] . "<br />\n" . $locale['u121']);
                 } else {
                     $this->_completeMessage = $locale['u169'];
                 }
                 $result = dbquery("UPDATE " . DB_USERS . " SET user_email='" . $data['user_email'] . "' WHERE user_id='" . $data['user_id'] . "'");
                 $result = dbquery("DELETE FROM " . DB_EMAIL_VERIFY . " WHERE user_id='" . $data['user_id'] . "'");
             }
         } else {
             redirect("index.php");
         }
     } else {
         redirect("index.php");
     }
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:27,代码来源:UserFieldsInput.php

示例3: redirect

+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "user_fields.php";
require_once THEMES . "templates/global/register.php";
include THEMES . "templates/global/profile.php";
$_GET['profiles'] = 1;
if (iMEMBER or $settings['enable_registration'] == 0) {
    redirect("index.php");
}
$errors = array();
if (isset($_GET['email']) && isset($_GET['code'])) {
    if (!preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $_GET['email'])) {
        redirect("register.php?error=activate");
    }
    if (!preg_check("/^[0-9a-z]{40}\$/", $_GET['code'])) {
        redirect("register.php?error=activate");
    }
    $result = dbquery("SELECT user_info FROM " . DB_NEW_USERS . " WHERE user_code='" . $_GET['code'] . "' AND user_email='" . $_GET['email'] . "'");
    if (dbrows($result) > 0) {
        add_to_title($locale['global_200'] . $locale['u155']);
        $data = dbarray($result);
        $user_info = unserialize(base64_decode($data['user_info']));
        dbquery_insert(DB_USERS, $user_info, 'save');
        $result = dbquery("DELETE FROM " . DB_NEW_USERS . " WHERE user_code='" . $_GET['code'] . "' LIMIT 1");
        if (fusion_get_settings('admin_activation') == 1) {
            addNotice("success", $locale['u171'] . " - " . $locale['u162'], 'all');
        } else {
            addNotice("success", $locale['u171'] . " - " . $locale['u161'], 'all');
        }
        redirect(fusion_get_settings('opening_page'));
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:register.php

示例4: _setUserEmail

 private function _setUserEmail()
 {
     global $locale, $settings;
     $this->_userEmail = isset($_POST['user_email']) ? stripinput(trim(preg_replace("/ +/i", " ", $_POST['user_email']))) : "";
     if ($this->_userEmail != "" && $this->_userEmail != $this->userData['user_email']) {
         // Require user password for email change
         if ($this->_isValidCurrentPassword) {
             // Require a valid email account
             if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $this->_userEmail)) {
                 $email_domain = substr(strrchr($this->_userEmail, "@"), 1);
                 if (dbcount("(blacklist_id)", DB_BLACKLIST, "blacklist_email='" . $this->_userEmail . "' OR blacklist_email='" . $email_domain . "'") != 0) {
                     $this->_setError("user_email", $locale['u124']);
                 } else {
                     $email_active = dbcount("(user_id)", DB_USERS, "user_email='" . $this->_userEmail . "'");
                     $email_inactive = dbcount("(user_code)", DB_NEW_USERS, "user_email='" . $this->_userEmail . "'");
                     if ($email_active == 0 && $email_inactive == 0) {
                         if ($this->verifyNewEmail && $settings['email_verification'] == "1") {
                             $this->_verifyNewEmail();
                         } else {
                             $this->_userLogFields[] = "user_email";
                             $this->_setDBValue("user_email", $this->_userEmail);
                         }
                     } else {
                         $this->_setError("user_email", $locale['u125']);
                     }
                 }
             } else {
                 $this->_setError("user_email", $locale['u123']);
             }
         } else {
             $this->_setError("user_email", $locale['u156']);
         }
     } else {
         $this->_setError("user_email", $locale['u126'], true);
     }
 }
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:36,代码来源:UserFieldsInput.class.php

示例5: validate_email

 private function validate_email($value, $default, $name, $id, $required = FALSE, $safemode = FALSE, $error_text = FALSE)
 {
     $value = stripinput(trim(preg_replace("/ +/i", " ", $value)));
     if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $value)) {
         return $value;
     } else {
         $this->stop();
         $this->addError($id);
         $this->addHelperText($id, $error_text);
         $this->addNotice("<b>{$name}</b> is not a valid email address.");
     }
 }
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:12,代码来源:defender.inc.php

示例6: verify_email

 /**
  * Checks if is a valid email address
  * accepts only 50 characters + @ + 4 characters
  * returns str the input or bool FALSE if check fails
  */
 protected function verify_email()
 {
     if ($this->field_config['required'] && !$this->field_value) {
         self::setInputError($this->field_name);
     }
     if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $this->field_value)) {
         return $this->field_value;
     }
     return FALSE;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:15,代码来源:defender.inc.php

示例7: author

| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
require_once INCLUDES . "suspend_include.php";
include LOCALE . LOCALESET . "reactivate.php";
if (iMEMBER) {
    redirect("index.php");
}
if (isset($_GET['user_id']) && isnum($_GET['user_id']) && isset($_GET['code']) && preg_check("/^[0-9a-z]{32}\$/", $_GET['code'])) {
    $result = dbquery("SELECT user_name, user_email, user_actiontime, user_password FROM " . DB_USERS . " WHERE user_id='" . $_GET['user_id'] . "' AND user_actiontime>'0' AND user_status='7'");
    if (dbrows($result)) {
        $data = dbarray($result);
        $code = md5($data['user_actiontime'] . $data['user_password']);
        if ($_GET['code'] == $code) {
            if ($data['user_actiontime'] > time()) {
                $result = dbquery("UPDATE " . DB_USERS . " SET user_status='0', user_actiontime='0', user_lastvisit='" . time() . "' WHERE user_id='" . $_GET['user_id'] . "'");
                unsuspend_log($_GET['user_id'], 7, $locale['506'], true);
                $message = str_replace("[USER_NAME]", $data['user_name'], $locale['505']);
                require_once INCLUDES . "sendmail_include.php";
                sendemail($data['user_name'], $data['user_email'], $settings['siteusername'], $settings['siteemail'], $locale['504'], $message);
                redirect(BASEDIR . "login.php");
            } else {
                redirect(FUSION_SELF . "?error=1");
            }
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:31,代码来源:reactivate.php

示例8: author

| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "members.php";
add_to_title($locale['global_200'] . $locale['400']);
opentable($locale['400']);
if (iMEMBER) {
    if (!isset($_GET['sortby']) || !ctype_alnum($_GET['sortby'])) {
        $_GET['sortby'] = "all";
    }
    $orderby = $_GET['sortby'] == "all" ? "" : " AND user_name LIKE '" . stripinput($_GET['sortby']) . "%'";
    $search_text = isset($_GET['search_text']) && preg_check("/^[-0-9A-Z_@\\s]+\$/i", $_GET['search_text']) ? $orderby = ' AND user_name LIKE "' . stripinput($_GET['search_text']) . '%"' : $_GET['sortby'];
    $result = dbquery("SELECT user_id FROM " . DB_USERS . " WHERE user_status='0'" . $orderby);
    $rows = dbrows($result);
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    if ($rows) {
        $i = 0;
        echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
        echo "<td class='tbl2'><strong>" . $locale['401'] . "</strong></td>\n";
        echo "<td class='tbl2'><strong>" . $locale['405'] . "</strong></td>\n";
        echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['402'] . "</strong></td>\n";
        echo "</tr>\n";
        $result = dbquery("SELECT user_id, user_name, user_status, user_level, user_groups FROM " . DB_USERS . " WHERE user_status='0'" . $orderby . " ORDER BY user_level DESC, user_name LIMIT " . $_GET['rowstart'] . ",20");
        while ($data = dbarray($result)) {
            $cell_color = $i % 2 == 0 ? "tbl1" : "tbl2";
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:31,代码来源:members.php

示例9: author

+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/comments.php";
if (!checkrights("C") || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
if (!isset($_GET['ctype']) || !preg_check("/^[0-9A-Z]+\$/i", $_GET['ctype'])) {
    redirect("../index.php");
}
if (!isset($_GET['cid']) || !isnum($_GET['cid'])) {
    redirect("../index.php");
}
if (isset($_GET['status']) && !isset($message)) {
    if ($_GET['status'] == "su") {
        $message = $locale['410'];
    } elseif ($_GET['status'] == "del") {
        $message = $locale['411'];
    }
    if ($message) {
        echo "<div class='admin-message'>" . $message . "</div>\n";
    }
}
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:comments.php

示例10: isnum

            if (!preg_match("/^[0-9A-Z@]{6,20}\$/i", $user_new_admin_password)) {
                $error .= $locale['440'] . "<br />\n";
            }
            if (encrypt_pw($user_new_admin_password) == encrypt_pw($user_new_password) || encrypt_pw($user_new_admin_password) == $user_data['user_password']) {
                $error .= $locale['439'] . "<br><br>\n";
            }
        }
    }
}
$user_hide_email = isnum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1";
if (!$error && !$user_data['user_avatar'] && !empty($_FILES['user_avatar']['name']) && is_uploaded_file($_FILES['user_avatar']['tmp_name'])) {
    require_once INCLUDES . "photo_functions_include.php";
    $file_types = array(".gif", ".jpg", ".jpeg", ".png");
    $avatar_name = str_replace(" ", "_", strtolower(substr($_FILES['user_avatar']['name'], 0, strrpos($_FILES['user_avatar']['name'], "."))));
    $avatar_ext = strtolower(strrchr($_FILES['user_avatar']['name'], "."));
    if (!preg_check("/^[-0-9A-Z_\\[\\]]+\$/i", $avatar_name)) {
        $error .= "Avatar file name is invalid.<br />\n";
    } elseif ($_FILES['user_avatar']['size'] > $settings['avatar_filesize']) {
        $error .= "Avatar file size is too big.<br />\n";
    } elseif (!in_array($avatar_ext, $file_types)) {
        $error .= "Avatar file type is invalid.<br />\n";
    } else {
        $avatar_temp = image_exists(IMAGES . "avatars/", "temp" . $avatar_ext);
        move_uploaded_file($_FILES['user_avatar']['tmp_name'], IMAGES . "avatars/" . $avatar_temp);
        chmod(IMAGES . "avatars/" . $avatar_temp, 0644);
        if (!verify_image(IMAGES . "avatars/" . $avatar_temp)) {
            @unlink(IMAGES . "avatars/" . $avatar_temp);
            $set_avatar = "";
        } else {
            $imagefile = getimagesize(IMAGES . "avatars/" . $avatar_temp);
            $avatar_file = image_exists(IMAGES . "avatars/", $avatar_name . $avatar_ext);
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:update_profile_include.php

示例11: author

| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include_once INCLUDES . "bbcode_include.php";
include LOCALE . LOCALESET . "submit.php";
if (!iMEMBER) {
    redirect("index.php");
}
if (!isset($_GET['stype']) || !preg_check("/^[a-z]\$/", $_GET['stype'])) {
    redirect("index.php");
}
$submit_info = array();
if ($_GET['stype'] == "l") {
    if (isset($_POST['submit_link'])) {
        if ($_POST['link_name'] != "" && $_POST['link_url'] != "" && $_POST['link_description'] != "") {
            $submit_info['link_category'] = stripinput($_POST['link_category']);
            $submit_info['link_name'] = stripinput($_POST['link_name']);
            $submit_info['link_url'] = stripinput($_POST['link_url']);
            $submit_info['link_description'] = stripinput($_POST['link_description']);
            $result = dbquery("INSERT INTO " . DB_SUBMISSIONS . " (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES ('l', '" . $userdata['user_id'] . "', '" . time() . "', '" . addslashes(serialize($submit_info)) . "')");
            add_to_title($locale['global_200'] . $locale['400']);
            opentable($locale['400']);
            echo "<div style='text-align:center'><br />\n" . $locale['410'] . "<br /><br />\n";
            echo "<a href='submit.php?stype=l'>" . $locale['411'] . "</a><br /><br />\n";
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:submit.php

示例12: dbarray

    $alias_uid = $userdata['user_id'];
} else {
    $alias_uid = $GLOBALS['user_id'];
}
$alias_foo1 = dbarray(dbquery('SELECT user_aliases FROM ' . DB_PREFIX . 'users WHERE user_id = ' . $alias_uid));
$user_data['user_aliases'] = alias1($alias_foo1['user_aliases']);
unset($alias_foo1);
if ($profile_method == "input") {
    echo "<tr>\n";
    echo "<td valign='top' class='tbl'>Vælg 3 aliaser - Det er tilladt at lade standart-værdien stå</td>\n";
    echo "<td class='tbl'>1: <input type='text' name='user_alias0' value='" . (isset($user_data['user_aliases']) ? $user_data['user_aliases'][0] : '') . "' /><br />2: <input type='text' name='user_alias1' value='" . (isset($user_data['user_aliases']) ? $user_data['user_aliases'][1] : '') . "' /><br />3: <input type='text' name='user_alias2' value='" . (isset($user_data['user_aliases']) ? $user_data['user_aliases'][2] : '') . "' /></td>\n";
    echo "</tr>\n";
} elseif ($profile_method == "display") {
    //Empty
} elseif ($profile_method == "validate_insert") {
    //Empty
} elseif ($profile_method == "validate_update") {
    global $user_data;
    if (!isset($_POST['user_alias0'], $_POST['user_alias1'], $_POST['user_alias2'])) {
        $this->_setError("user_aliases", 'Et eller flere af aliaserne er tomme!');
    } elseif (preg_check("/^[-0-9A-Z_@\\sæøåÆØÅ]{3,30}\$/i", $_POST['user_alias0']) && preg_check("/^[-0-9A-Z_@\\sæøåÆØÅ]{3,30}\$/i", $_POST['user_alias1']) && preg_check("/^[-0-9A-Z_@\\sæøåÆØÅ]{3,30}\$/i", $_POST['user_alias2']) && $_POST['user_alias0'] !== $_POST['user_alias1'] && $_POST['user_alias1'] !== $_POST['user_alias2'] && $_POST['user_alias2'] !== $_POST['user_alias0']) {
        $ualias1_result = dbquery('SELECT user_aliases, user_id FROM ' . DB_PREFIX . 'users WHERE user_aliases REGEXP "^.*,(' . $_POST['user_alias0'] . '|' . $_POST['user_alias1'] . '|' . $_POST['user_alias2'] . '),.*$" AND user_id != ' . $alias_uid);
        if (dbrows($ualias1_result) > 0) {
            $this->_setError("user_aliases", 'Et eller flere af aliaserne er optagede!');
        } else {
            $db_values .= ', user_aliases=",' . $_POST['user_alias0'] . ',' . $_POST['user_alias1'] . ',' . $_POST['user_alias2'] . ',"';
        }
    } else {
        $this->_setError("user_aliases", 'Et eller flere af aliaserne er ugyldige!');
    }
}
开发者ID:necrophcodr,项目名称:Muks,代码行数:31,代码来源:user_aliases_include.php

示例13: setInbox

 private function setInbox()
 {
     global $locale, $userdata;
     /**
      * Sanitize environment
      */
     $myStatus = self::get_pm_settings($userdata['user_id']);
     //print_p($myStatus);
     if (!isset($_GET['folder']) || !preg_check("/^(inbox|outbox|archive|options)\$/", $_GET['folder'])) {
         $_GET['folder'] = "inbox";
     }
     function validate_user($user_id)
     {
         if (isnum($user_id) && dbcount("(user_id)", DB_USERS, "user_id='" . intval($user_id) . "' AND user_status ='0'")) {
             return TRUE;
         }
         return FALSE;
     }
     if (isset($_POST['msg_send']) && isnum($_POST['msg_send']) && validate_user($_POST['msg_send'])) {
         $_GET['msg_send'] = $_POST['msg_send'];
     }
     // prohibits send message to non-existing group
     $user_group = fusion_get_groups();
     unset($user_group[0]);
     if (isset($_POST['msg_to_group']) && isnum($_POST['msg_to_group']) && isset($user_group[$_POST['msg_to_group']])) {
         $_GET['msg_to_group'] = $_POST['msg_to_group'];
     }
     $this->info = array("folders" => array("inbox" => array("link" => BASEDIR . "messages.php?folder=inbox", "title" => $locale['402']), "outbox" => array("link" => BASEDIR . "messages.php?folder=outbox", "title" => $locale['403']), "archive" => array("link" => BASEDIR . "messages.php?folder=archive", "title" => $locale['404']), "options" => array("link" => BASEDIR . "messages.php?folder=options", "title" => $locale['425'])), "inbox_total" => dbrows(dbquery("SELECT message_id FROM " . DB_MESSAGES . " WHERE message_user='" . $userdata['user_id'] . "' and message_to='" . $userdata['user_id'] . "' AND message_folder='0'")), "outbox_total" => dbrows(dbquery("SELECT message_id FROM " . DB_MESSAGES . " WHERE message_user='" . $userdata['user_id'] . "' and message_to='" . $userdata['user_id'] . "' AND message_folder='1'")), "archive_total" => dbrows(dbquery("SELECT message_id FROM " . DB_MESSAGES . " WHERE message_user='" . $userdata['user_id'] . "' and message_to='" . $userdata['user_id'] . "' AND message_folder='2'")), "button" => array("new" => array('link' => BASEDIR . "messages.php?msg_send=new", 'name' => $locale['401']), "options" => array('link' => BASEDIR . "messages.php?folder=options", 'name' => $locale['425'])), "actions_form" => "");
     add_to_title($locale['global_200'] . $locale['400']);
     add_to_meta("description", $locale['400']);
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:PrivateMessages.php

示例14: elseif

        $page_content .= "<strong>" . $locale['global_411'] . "</strong><br /><br />\n";
        $page_refresh = "10";
    } elseif (isset($_GET['error']) && $_GET['error'] == 6) {
        // anonymized/deleted
        $page_content .= "<strong>" . $locale['global_412'] . "</strong><br /><br />\n";
        $page_refresh = "10";
    } elseif (isset($_GET['error']) && $_GET['error'] == 8) {
        // username/password does not match
        $page_content .= "<strong>" . $locale['global_196'] . "</strong><br /><br />\n";
    } else {
        if ($settings['login_method'] == "cookies" && isset($_COOKIE[COOKIE_PREFIX . 'user']) || $settings['login_method'] == "sessions" && isset($_SESSION[COOKIE_PREFIX . 'user_id']) && isset($_SESSION[COOKIE_PREFIX . 'user_pass'])) {
            if ($settings['login_method'] == "cookies") {
                $cookie_vars = explode(".", $_COOKIE[COOKIE_PREFIX . 'user']);
                $user_pass = preg_check("/^[0-9a-z]{32}\$/", $cookie_vars['1']) ? $cookie_vars['1'] : "";
            } elseif ($settings['login_method'] == "sessions") {
                $user_pass = preg_check("/^[0-9a-z]{32}\$/", $_SESSION[COOKIE_PREFIX . 'user_pass']) ? $_SESSION[COOKIE_PREFIX . 'user_pass'] : "";
            }
            $user_name = preg_replace(array("/\\=/", "/\\#/", "/\\sOR\\s/"), "", stripinput($_GET['user']));
            if (!dbcount("(user_id)", DB_USERS, "user_name='" . $user_name . "' AND user_password='" . encrypt_pw_part2($user_pass) . "'")) {
                $page_content .= "<strong>" . $locale['global_196'] . "</strong><br /><br />\n";
            } else {
                $result = dbquery("DELETE FROM " . DB_ONLINE . " WHERE online_user='0' AND online_ip='" . USER_IP . "'");
                $page_content .= "<strong>" . $locale['global_193'] . $_GET['user'] . "</strong><br /><br />\n";
            }
        }
    }
}
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html>\n<head>\n";
echo "<title>" . $settings['sitename'] . "</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=" . $locale['charset'] . "' />\n";
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:setuser.php

示例15: dbquery

        }
    } else {
        $result = dbquery("SELECT user_id FROM " . DB_USERS . " WHERE user_name='" . $user_name . "' LIMIT 1");
        // Pimped ->
        if (dbrows($result)) {
            $data = dbarray($result);
            dbquery("INSERT INTO " . DB_FAILED_LOGINS . " (user_id, datestamp, logged_ip) VALUES ('" . $data['user_id'] . "', '" . time() . "', '" . USER_IP . "')");
        }
        // Pimped <-
        redirect(BASEDIR . "setuser.php?error=8");
    }
}
if (isset($_COOKIE[COOKIE_PREFIX . 'user'])) {
    $cookie_vars = explode(".", $_COOKIE[COOKIE_PREFIX . 'user']);
    $cookie_1 = isnum($cookie_vars['0']) ? $cookie_vars['0'] : "0";
    $cookie_2 = preg_check("/^[0-9a-z]{32}\$/", $cookie_vars['1']) ? $cookie_vars['1'] : "";
    $result = dbquery("SELECT * FROM " . DB_USERS . " WHERE user_id='" . $cookie_1 . "' AND user_password='" . encrypt_pw_part2($cookie_2) . "' LIMIT 1");
    unset($cookie_vars, $cookie_2);
    // Pimped
    if (dbrows($result)) {
        $userdata = dbarray($result);
        if ($userdata['user_status'] == 0) {
            if ($userdata['user_theme'] != "Default" && file_exists(THEMES . $userdata['user_theme'] . "/theme.php") && ($settings['userthemes'] == 1 || $userdata['user_level'] >= nADMIN)) {
                if (!theme_exists($userdata['user_theme'])) {
                    echo "<strong>" . $settings['sitename'] . " - " . $locale['global_300'] . ".</strong><br /><br />\n";
                    echo $locale['global_301'];
                    die;
                }
            } else {
                if (!theme_exists($settings['theme'])) {
                    echo "<strong>" . $settings['sitename'] . " - " . $locale['global_300'] . ".</strong><br /><br />\n";
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:cookie_include.php


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