• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP validatePassword函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ValidateRegisterForm

function ValidateRegisterForm($post)
{
    if (validateFirstName($post['firstName']) && validateLastName($post['lastName']) && validateEmail($post['email']) && validatePassword($post['password']) && validateConfirmPassword($post['confirmPassword']) && validateGender($post['gender']) && validateContactNumber($post['contactNumber']) && validateAddress($post['address'])) {
        return true;
    } else {
        return false;
    }
}
开发者ID:pawans-optimus,项目名称:php_induction,代码行数:8,代码来源:validateRegisterForm.php


示例2: init

 function init()
 {
     if ($this->esoTalk->user) {
         redirect("");
     }
     global $language, $messages, $config;
     $this->title = $language["Forgot your password"];
     $this->esoTalk->addToHead("<meta name='robots' content='noindex, noarchive'/>");
     // If we're on the second step (they've clicked the link in their email)
     if ($hash = @$_GET["q2"]) {
         // Get the user with this recover password hash
         $result = $this->esoTalk->db->query("SELECT memberId FROM {$config["tablePrefix"]}members WHERE resetPassword='{$hash}'");
         if (!$this->esoTalk->db->numRows($result)) {
             redirect("forgotPassword");
         }
         list($memberId) = $this->esoTalk->db->fetchRow($result);
         $this->setPassword = true;
         // Validate the form if it was submitted
         if (isset($_POST["changePassword"])) {
             $password = @$_POST["password"];
             $confirm = @$_POST["confirm"];
             if ($error = validatePassword(@$_POST["password"])) {
                 $this->errors["password"] = $error;
             }
             if ($password != $confirm) {
                 $this->errors["confirm"] = "passwordsDontMatch";
             }
             if (!count($this->errors)) {
                 $passwordHash = md5($config["salt"] . $password);
                 $this->esoTalk->db->query("UPDATE {$config["tablePrefix"]}members SET resetPassword=NULL, password='{$passwordHash}' WHERE memberId={$memberId}");
                 $this->esoTalk->message("passwordChanged", false);
                 redirect("");
             }
         }
     }
     // If they've submitted their email for a password link, email them!
     if (isset($_POST["email"])) {
         // Find the member with this email
         $result = $this->esoTalk->db->query("SELECT memberId, name, email FROM {$config["tablePrefix"]}members WHERE email='{$_POST["email"]}'");
         if (!$this->esoTalk->db->numRows($result)) {
             $this->esoTalk->message("emailDoesntExist");
             return;
         }
         list($memberId, $name, $email) = $this->esoTalk->db->fetchRow($result);
         // Set a special 'forgot password' hash
         $hash = md5(rand());
         $this->esoTalk->db->query("UPDATE {$config["tablePrefix"]}members SET resetPassword='{$hash}' WHERE memberId={$memberId}");
         // Send the email
         if (sendEmail($email, sprintf($language["emails"]["forgotPassword"]["subject"], $name), sprintf($language["emails"]["forgotPassword"]["body"], $name, $config["forumTitle"], $config["baseURL"] . makeLink("forgot-password", $hash)))) {
             $this->esoTalk->message("passwordEmailSent", false);
             redirect("");
         }
     }
 }
开发者ID:bk-amahi,项目名称:esoTalk,代码行数:54,代码来源:forgot-password.controller.php


示例3: validatePasswordHandle

 public function validatePasswordHandle($password)
 {
     global $sourcedir;
     require_once $sourcedir . '/Subs-Auth.php';
     $passwordError = validatePassword($password, $regOptions['username'], array($regOptions['email']));
     // Password isn't legal?
     if ($passwordError != null) {
         return false;
     }
     return true;
 }
开发者ID:keweiliu6,项目名称:test-smf2,代码行数:11,代码来源:TTSSOForum.php


示例4: authAdmin

function authAdmin($username, $password)
{
    global $config;
    if (!checkLock("checkadmin")) {
        return false;
    }
    if ($config['admin_username'] == $username && validatePassword($password, $config['admin_password'], $config['admin_passwordformat'])) {
        return true;
    } else {
        lockAction("checkadmin");
        return false;
    }
}
开发者ID:andregirol,项目名称:uxpanel,代码行数:13,代码来源:auth.php


示例5: UserSignUp

 function UserSignUp()
 {
     if (isset($_POST['su-btn-submit'])) {
         if (isset($_POST['email']) && isset($_POST['username']) && isset($_POST['password']) && isset($_POST['confirm-password']) && isset($_POST['tos-checkbox'])) {
             //Get submitted values
             $email = validateEmail($_POST['email']) ? 1 : 0;
             $user = validateUsername($_POST['username']) ? 1 : 0;
             $password = validatePassword($_POST['password']) ? 1 : 0;
             $password_hash = password_hash($_POST['password'], PASSWORD_DEFAULT);
             $cf_pass = password_verify($_POST['confirm-password'], $password_hash) ? 1 : 0;
             $tos_cb = $_POST['tos-checkbox'] ? 1 : 0;
         }
     }
 }
开发者ID:ansidev,项目名称:maya-notes-web,代码行数:14,代码来源:site.class.php


示例6: verification

function verification($username, $password)
{
    // On va récupérer l'utilisateur précis
    $reponse = getUser($username);
    // On vérifie si l'adresse email et mot de passe correspondent
    if (validatePassword($username, $password)) {
        $connected = true;
        // le nom et le prénom servent à assurer à l'utilisateur qu'il est connecté
        // et connecté avec le bon compte
        $_SESSION['first_name'] = $reponse[0]['Prenom'];
        $_SESSION['last_name'] = $reponse[0]['Nom'];
        // nécessaire pour valider le niveau d'accès de l'utilisateur
        $_SESSION['user_type'] = $reponse[0]['TypeUtilisateur'];
        //nécessaire pour accéder à d'autres informations liées à l'utilisateur plus loin
        // dans la session
        $_SESSION['no_user'] = $reponse[0]['NoUtilisateur'];
    } else {
        $connected = false;
    }
    return $connected;
}
开发者ID:Waverealm,项目名称:Projet_Plan-Cadre,代码行数:21,代码来源:controller_login.php


示例7: getDataErrors

function getDataErrors($data)
{
    $messages = [];
    if (empty($data['first_name']) || empty($data['last_name']) || empty($data['username']) || empty($data['password'])) {
        $messages[] = 'Παρακαλούμε συμπληρώστε όλα τα πεδία';
        return $messages;
    }
    if (!validateName($data['first_name'])) {
        $messages[] = 'Το όνομα σας περιέχει μη επιτρεπτούς χαρακτήρες. Παρακαλούμε εισάγετε μόνο γράμματα της αλφαβήτας';
    }
    if (!validateName($data['last_name'])) {
        $messages[] = 'Το επώνυμό σας περιέχει μη επιτρεπτούς χαρακτήρες. Παρακαλούμε εισάγετε μόνο γράμματα της αλφαβήτας';
    }
    if (!validateUsername($data['username'])) {
        $messages[] = 'Το username σας περιέχει μη πετρεπτούς χαρακτήρες. Παρακαλούμε εισάγετε μόνο λατινικούς χαρακτήρες και αριθμούς';
    }
    if (!validateEmail($data['email'])) {
        $messages[] = 'Το e-mail σας δεν είναι έγκυρο. Παρακούμε εισάγετε ένα έγκυρο e-mail.';
    }
    if (!validatePassword($data['password'])) {
        $messages[] = 'Μη επιτρεπτός κωδικός. Ο κωδικός σας πρέπει να περιλαμβάνει τουλάχιστον 8 ψηφία.';
    }
    return $messages;
}
开发者ID:AlexandrosKal,项目名称:mylib,代码行数:24,代码来源:validation_functions.php


示例8: validatePassword

<?php

if (isset($_POST["submit_update_user"])) {
    $id = $_GET['id'];
    $changepass = false;
    //$username = $_POST['new_user_username'];
    //$username = validateUserName($username) ? $_POST['new_user_username'] : false;
    if (!empty($_POST['new_user_password'])) {
        $changepass = true;
        $bh_password = $_POST['new_user_password'];
        $bh_password = validatePassword($bh_password) ? $_POST['new_user_password'] : false;
        $password = passwordHash($bh_password);
    }
    $email = $_POST['new_user_email'];
    //$vip = isset($_POST['new_user_vip']) ? 1 : 0;
    $bp_role = $_POST['new_user_role'];
    $bp_vip = $_POST['new_user_vip'];
    if ($bp_vip == 0) {
        $vip = 0;
        $vip_start = null;
        $vip_expire = null;
    } elseif ($bp_vip == -1) {
        $vip = -1;
        $vip_start = $current_datetime;
        $vip_expire = null;
    } else {
        $vip = $bp_vip;
        $vip_start = strtotime($current_datetime);
        $vip_expire = strtotime('+' . $vip . ' day', $vip_start);
        $vip_start = $current_datetime;
        $vip_expire = date('Y-m-d H:i:s', $vip_expire);
开发者ID:VSG24,项目名称:ccms,代码行数:31,代码来源:submit_update_user.php


示例9: enter

<?php

echo '<html>';
echo '<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="public/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="public/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="public/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>';
enter();
echo '<form method="POST" action="http://localhost:8000">
<div class="form-group">
    <label for="exampleInputLogin">Login:</label>
    <input type="text"  class="form-control" id="exampleInputLogin" name="login"/><br/>' . validateLogin($_REQUEST['login']) . '
</div>
<div class="form-group">
    <label for="exampleInputPassword1">Password</label>
    <input type="text"  class="form-control" id="exampleInputPassword" name="password"/></br>' . validatePassword($_REQUEST['password']) . '
</div>
<input type="submit" class="btn btn-default" value="Send"/>
</form>';
enter();
echo '<a href="/src/reg.php">Зарегистрируйтесь</a>';
echo '</html>';
/* http://getbootstrap.com/getting-started/#template - Sign-in page    http://getbootstrap.com/examples/signin/ */
/*сделать форму регистрации*/
开发者ID:Grotesquee,项目名称:Lesson,代码行数:28,代码来源:view_login.php


示例10: getPOST

 $form['message'] = getPOST('message');
 $form['captchaValue'] = getPOST('captchaValue');
 $form['captchaId'] = getPOST('captchaId');
 // Add datetime
 date_default_timezone_set('Europe/Berlin');
 $form['date'] = date("F j, Y, g:i a");
 // Check for empty fields
 foreach ($form as $key => $value) {
     if (!$value) {
         $errorMsg .= 'The field "' . $key . '" may not be empty.<br>';
     }
 }
 if (!validateEmail($form['email'])) {
     $errorMsg .= "Please check your email address entered.<br>";
 }
 if (!validatePassword($form['password'], $form['confirmPassword'])) {
     $errorMsg .= "Passwords does not match.<br>";
 }
 if (!validateCaptcha($form['captchaValue'], $form['captchaId'])) {
     $errorMsg .= "Please check captcha.<br>";
 }
 // Remember selectbox
 for ($i == 1; $i < 4; $i++) {
     if ($form['subject'] == $i) {
         $formHelper['select' . $i] = "selected=selected";
     }
 }
 ## Store if validation was successful
 if (!$errorMsg) {
     // Save in textfile for demo reasons only.
     // Passwords are not filtered and stored in plaintext, hash function with salt and pepper must be used!
开发者ID:changkun,项目名称:assignments-ws-15-16,代码行数:31,代码来源:index.php


示例11: registerMember

function registerMember(&$regOptions, $return_errors = false)
{
    global $scripturl, $txt, $modSettings, $context, $sourcedir;
    global $user_info, $options, $settings, $smcFunc;
    loadLanguage('Login');
    // We'll need some external functions.
    require_once $sourcedir . '/lib/Subs-Auth.php';
    require_once $sourcedir . '/lib/Subs-Post.php';
    // Put any errors in here.
    $reg_errors = array();
    // Registration from the admin center, let them sweat a little more.
    if ($regOptions['interface'] == 'admin') {
        is_not_guest();
        isAllowedTo('moderate_forum');
    } elseif ($regOptions['interface'] == 'guest') {
        // You cannot register twice...
        if (empty($user_info['is_guest'])) {
            redirectexit();
        }
        // Make sure they didn't just register with this session.
        if (!empty($_SESSION['just_registered']) && empty($modSettings['disableRegisterCheck'])) {
            fatal_lang_error('register_only_once', false);
        }
    }
    // What method of authorization are we going to use?
    if (empty($regOptions['auth_method']) || !in_array($regOptions['auth_method'], array('password', 'openid'))) {
        if (!empty($regOptions['openid'])) {
            $regOptions['auth_method'] = 'openid';
        } else {
            $regOptions['auth_method'] = 'password';
        }
    }
    // No name?!  How can you register with no name?
    if (empty($regOptions['username'])) {
        $reg_errors[] = array('lang', 'need_username');
    }
    // Spaces and other odd characters are evil...
    $regOptions['username'] = preg_replace('~[\\t\\n\\r\\x0B\\0' . ($context['server']['complex_preg_chars'] ? '\\x{A0}' : " ") . ']+~u', ' ', $regOptions['username']);
    // Don't use too long a name.
    if (commonAPI::strlen($regOptions['username']) > 25) {
        $reg_errors[] = array('lang', 'error_long_name');
    }
    // Only these characters are permitted.
    if (preg_match('~[<>&"\'=\\\\]~', preg_replace('~&#(?:\\d{1,7}|x[0-9a-fA-F]{1,6});~', '', $regOptions['username'])) != 0 || $regOptions['username'] == '_' || $regOptions['username'] == '|' || strpos($regOptions['username'], '[code') !== false || strpos($regOptions['username'], '[/code') !== false) {
        $reg_errors[] = array('lang', 'error_invalid_characters_username');
    }
    if (commonAPI::strtolower($regOptions['username']) === commonAPI::strtolower($txt['guest_title'])) {
        $reg_errors[] = array('lang', 'username_reserved', 'general', array($txt['guest_title']));
    }
    // !!! Separate the sprintf?
    if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\\-/][0-9A-Za-z=_\'+\\-/\\.]*@[\\w\\-]+(\\.[\\w\\-]+)*(\\.[\\w]{2,6})$~', $regOptions['email']) === 0 || strlen($regOptions['email']) > 255) {
        $reg_errors[] = array('done', sprintf($txt['valid_email_needed'], commonAPI::htmlspecialchars($regOptions['username'])));
    }
    if (!empty($regOptions['check_reserved_name']) && isReservedName($regOptions['username'], 0, false)) {
        if ($regOptions['password'] == 'chocolate cake') {
            $reg_errors[] = array('done', 'Sorry, I don\'t take bribes... you\'ll need to come up with a different name.');
        }
        $reg_errors[] = array('done', '(' . htmlspecialchars($regOptions['username']) . ') ' . $txt['name_in_use']);
    }
    // Generate a validation code if it's supposed to be emailed.
    $validation_code = '';
    if ($regOptions['require'] == 'activation') {
        $validation_code = generateValidationCode();
    }
    // If you haven't put in a password generate one.
    if ($regOptions['interface'] == 'admin' && $regOptions['password'] == '' && $regOptions['auth_method'] == 'password') {
        mt_srand(time() + 1277);
        $regOptions['password'] = generateValidationCode();
        $regOptions['password_check'] = $regOptions['password'];
    } elseif ($regOptions['password'] != $regOptions['password_check'] && $regOptions['auth_method'] == 'password') {
        $reg_errors[] = array('lang', 'passwords_dont_match');
    }
    // That's kind of easy to guess...
    if ($regOptions['password'] == '') {
        if ($regOptions['auth_method'] == 'password') {
            $reg_errors[] = array('lang', 'no_password');
        } else {
            $regOptions['password'] = sha1(mt_rand());
        }
    }
    // Now perform hard password validation as required.
    if (!empty($regOptions['check_password_strength'])) {
        $passwordError = validatePassword($regOptions['password'], $regOptions['username'], array($regOptions['email']));
        // Password isn't legal?
        if ($passwordError != null) {
            $reg_errors[] = array('lang', 'profile_error_password_' . $passwordError);
        }
    }
    // If they are using an OpenID that hasn't been verified yet error out.
    // !!! Change this so they can register without having to attempt a login first
    if ($regOptions['auth_method'] == 'openid' && (empty($_SESSION['openid']['verified']) || $_SESSION['openid']['openid_uri'] != $regOptions['openid'])) {
        $reg_errors[] = array('lang', 'openid_not_verified');
    }
    // You may not be allowed to register this email.
    if (!empty($regOptions['check_email_ban'])) {
        isBannedEmail($regOptions['email'], 'cannot_register', $txt['ban_register_prohibited']);
    }
    // Check if the email address is in use.
    $request = smf_db_query('
		SELECT id_member
//.........这里部分代码省略.........
开发者ID:norv,项目名称:EosAlpha,代码行数:101,代码来源:Subs-Members.php


示例12:

    echo $styleInvalid;
}
?>
 />
		            				<span class="formcheck" id="spanUsername"> </span><br />
	
	            <label>Password:</label>
	            	<input type="password" name="PASSWORD" size="30" id="passwd" class="validates" 
	            		onfocus="pValid()" />
	            			<span class="formcheck" id="spanP"></span><br />
	
	            <label>Confirm Password:</label>
	           		<input type="password" name="CONFIRMPASSWORD" size="30" id="confirmPasswd" class="validates" 
	           			onkeyup="passwdValid()" 
	           				<?php 
if (!validatePassword($password1, $password2)) {
    echo $styleInvalid;
}
?>
 />
	            				<span class="formcheck" id="spanPasswd"></span><br />
	
	        </fieldset>
	        <fieldset id="fieldYN">
	            Gender:
		            <input type="radio" name="GENDER" value="male" id="maleRadio" /><label class="noLabel" for="maleRadio">Male </label>
		            <input type="radio" name="GENDER" value="female" id="femaleRadio" /><label class="noLabel" for="femaleRadio">Female </label><?php 
if (!validateGender($gender)) {
    echo "*";
}
?>
开发者ID:pviker,项目名称:GroupProject,代码行数:31,代码来源:register.php


示例13: authentication

function authentication($memID, $saving = false)
{
    global $context, $cur_profile, $sourcedir, $txt, $post_errors, $modSettings;
    loadLanguage('Login');
    // We are saving?
    if ($saving) {
        // Moving to password passed authentication?
        if ($_POST['authenticate'] == 'passwd') {
            // Didn't enter anything?
            if ($_POST['passwrd1'] == '') {
                $post_errors[] = 'no_password';
            } elseif (!isset($_POST['passwrd2']) || $_POST['passwrd1'] != $_POST['passwrd2']) {
                $post_errors[] = 'bad_new_password';
            } else {
                require_once $sourcedir . '/Subs-Auth.php';
                $passwordErrors = validatePassword($_POST['passwrd1'], $cur_profile['member_name'], array($cur_profile['real_name'], $cur_profile['email_address']));
                // Were there errors?
                if ($passwordErrors != null) {
                    $post_errors[] = 'password_' . $passwordErrors;
                }
            }
            if (empty($post_errors)) {
                // Integration?
                call_integration_hook('integrate_reset_pass', array($cur_profile['member_name'], $cur_profile['member_name'], $_POST['passwrd1']));
                // Go then.
                $passwd = sha1(strtolower($cur_profile['member_name']) . un_htmlspecialchars($_POST['passwrd1']));
                // Do the important bits.
                updateMemberData($memID, array('openid_uri' => '', 'passwd' => $passwd));
                if ($context['user']['is_owner']) {
                    setLoginCookie(60 * $modSettings['cookieTime'], $memID, sha1(sha1(strtolower($cur_profile['member_name']) . un_htmlspecialchars($_POST['passwrd2'])) . $cur_profile['password_salt']));
                }
                redirectexit('action=profile;u=' . $memID);
            }
            return true;
        } elseif ($_POST['authenticate'] == 'openid' && !empty($_POST['openid_identifier'])) {
            require_once $sourcedir . '/Subs-OpenID.php';
            $_POST['openid_identifier'] = smf_openID_canonize($_POST['openid_identifier']);
            if (smf_openid_member_exists($_POST['openid_identifier'])) {
                $post_errors[] = 'openid_in_use';
            } elseif (empty($post_errors)) {
                // Authenticate using the new OpenID URI first to make sure they didn't make a mistake.
                if ($context['user']['is_owner']) {
                    $_SESSION['new_openid_uri'] = $_POST['openid_identifier'];
                    smf_openID_validate($_POST['openid_identifier'], false, null, 'change_uri');
                } else {
                    updateMemberData($memID, array('openid_uri' => $_POST['openid_identifier']));
                }
            }
        }
    }
    // Some stuff.
    $context['member']['openid_uri'] = $cur_profile['openid_uri'];
    $context['auth_method'] = empty($cur_profile['openid_uri']) ? 'password' : 'openid';
    $context['sub_template'] = 'authentication_method';
}
开发者ID:valek0972,项目名称:hackits,代码行数:55,代码来源:Profile-Modify.php


示例14: count

<?php

include "validate.php";
$formSend = count($_POST) > 0;
$username = "";
$email = "";
if ($formSend) {
    $usernameValid = validateUsername($_POST["username"]);
    $emailValid = validateEmail($_POST["email"]);
    $passwordValid = validatePassword($_POST["password"]);
    $passwordCValid = validateCPassword($_POST["password"], $_POST["passwordC"]);
    $username = htmlspecialchars($_POST["username"]);
    $email = htmlspecialchars($_POST["email"]);
    if ($usernameValid == "" && $emailValid == "" && $passwordValid == "" && $passwordCValid == "") {
        header('Location: welcome.php?username=' . strip_tags($_POST["username"]));
    }
}
?>

<!DOCTYPE html>
<html>
<head>
  <title>Register</title>
  <link type='text/css' rel='stylesheet' href='style.css'/>
  <script src="jquery-2.1.4.min.js"></script>
  <script src="jquery.validate.js"></script>
  <script type="text/javascript" src="registration.js"></script>
  <script type="text/javascript" src="script.js"></script>
</head>
<body>
  <header>
开发者ID:nerf3d,项目名称:zwa_semestralka,代码行数:31,代码来源:register.php


示例15: eval

                 eval("echo \"" . getTemplate("email/account_add") . "\";");
             }
         }
     } else {
         standard_error(array('allresourcesused', 'allocatetoomuchquota'), $quota);
     }
 } elseif ($action == 'changepw' && $id != 0) {
     $result = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `popaccountid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `id`='" . (int) $id . "'");
     if (isset($result['popaccountid']) && $result['popaccountid'] != '') {
         if (isset($_POST['send']) && $_POST['send'] == 'send') {
             $password = validate($_POST['email_password'], 'password');
             if ($password == '') {
                 standard_error(array('stringisempty', 'mypassword'));
                 exit;
             }
             $password = validatePassword($password);
             $log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
             $result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `id`='" . (int) $result['popaccountid'] . "'");
             redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
         } else {
             $result['email_full'] = $idna_convert->decode($result['email_full']);
             $result = htmlentities_array($result);
             $account_changepw_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php');
             $account_changepw_form = htmlform::genHTMLForm($account_changepw_data);
             $title = $account_changepw_data['emails_accountchangepasswd']['title'];
             $image = $account_changepw_data['emails_accountchangepasswd']['image'];
             eval("echo \"" . getTemplate("email/account_changepw") . "\";");
         }
     }
 } elseif ($action == 'changequota' && $settings['system']['mail_quota_enabled'] == '1' && $id != 0) {
     $result = $db->query_first("SELECT `v`.`id`, `v`.`email`, `v`.`email_full`, `v`.`iscatchall`, `v`.`destination`, `v`.`customerid`, `v`.`popaccountid`, `u`.`quota` FROM `" . TABLE_MAIL_VIRTUAL . "` `v` LEFT JOIN `" . TABLE_MAIL_USERS . "` `u` ON(`v`.`popaccountid` = `u`.`id`)WHERE `v`.`customerid`='" . (int) $userinfo['customerid'] . "' AND `v`.`id`='" . (int) $id . "'");
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:31,代码来源:customer_email.php


示例16: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result;
    if (isset($_POST["input_admin_username"]) == true) {
        $input_admin_username = htmlEncode2(validateGenericInput($_POST["input_admin_username"]));
    } else {
        $input_admin_username = "";
    }
    if (isset($_POST["input_admin_password"]) == true) {
        $input_admin_password = htmlEncode2(validateGenericInput($_POST["input_admin_password"]));
    } else {
        $input_admin_password = "";
    }
    if (isset($_POST["dbusername2"]) == true) {
        $dbusername2 = validateUsername($_POST["dbusername2"]);
    } else {
        $dbusername2 = "";
    }
    if (isset($_POST["dbpassword2"]) == true) {
        $dbpassword2 = validatePassword($_POST["dbpassword2"]);
    } else {
        $dbpassword2 = "";
    }
    if (isset($_POST["dbname2"]) == true) {
        $dbname2 = validateGenericInput($_POST["dbname2"]);
    } else {
        $dbname2 = "";
    }
    if (isset($_POST["dbserver2"]) == true) {
        $dbserver2 = validateGenericInput($_POST["dbserver2"]);
    } else {
        $dbserver2 = "";
    }
    $dbusername2_html = htmlEncode2($dbusername2);
    $dbpassword2_html = htmlEncode2($dbpassword2);
    $dbname2_html = htmlEncode2($dbname2);
    $dbserver2_html = htmlEncode2($dbserver2);
    if ($dbserver2 == "") {
        $dbserver2 = "localhost";
    }
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Output variable
    $net2ftp_output["admin_createtables"][] = "";
    // Title
    $title = __("Admin functions");
    // Form name
    $formname = "AdminForm";
    // Read the SQL file
    $filename = glueDirectories($net2ftp_globals["application_rootdir"], "create_tables.sql");
    $handle = fopen($filename, "rb");
    // Open the file for reading only
    if ($handle == false) {
        $net2ftp_output["admin_createtables"][] = __("The handle of file %1\$s could not be opened.", $filename);
    }
    clearstatcache();
    // for filesize
    $sqlquerystring = fread($handle, filesize($filename));
    if ($sqlquerystring == false) {
        $net2ftp_output["admin_createtables"][] = __("The file %1\$s could not be opened.", $filename);
    }
    $result1 = fclose($handle);
    if ($result1 == false) {
        $net2ftp_output["admin_createtables"][] = __("The handle of file %1\$s could not be closed.", $filename);
    }
    // Split the SQL file in individual queries
    $sqlquerypieces = explode("\n", $sqlquerystring);
    // -------------------------------------------------------------------------
    // Variables for screen 1
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["screen"] == 1) {
        // Next screen
        $nextscreen = 2;
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
        $forward_onclick = "document.forms['" . $formname . "'].submit();";
    } elseif ($net2ftp_globals["screen"] == 2) {
        // Next screen
        $nextscreen = 1;
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='admin';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
        $dbpassword2_length = strlen($dbpassword2);
        // ------------------------------------
        // Connect
        // ------------------------------------
        $mydb = mysql_connect($dbserver2, $dbusername2, $dbpassword2);
        if ($mydb == false) {
            $net2ftp_output["admin_createtables"][] = __("The connection to the server <b>%1\$s</b> could not be set up. Please check the database settings you've entered.", $dbserver2_html) . "\n";
        }
        // ------------------------------------
        // Select
        // ------------------------------------
        if ($mydb != false) {
//.........这里部分代码省略.........
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:101,代码来源:admin_createtables.inc.php


示例17: setPassword2

function setPassword2()
{
    global $db_prefix, $context, $txt, $modSettings, $sourcedir;
    if (empty($_POST['u']) || !isset($_POST['passwrd1']) || !isset($_POST['passwrd2'])) {
        fatal_lang_error(1, false);
    }
    $_POST['u'] = (int) $_POST['u'];
    if ($_POST['passwrd1'] != $_POST['passwrd2']) {
        fatal_lang_error(213, false);
    }
    if ($_POST['passwrd1'] == '') {
        fatal_lang_error(91, false);
    }
    loadLanguage('Login');
    // Get the code as it should be from the database.
    $request = db_query("\n\t\tSELECT validation_code, memberName, emailAddress\n\t\tFROM {$db_prefix}members\n\t\tWHERE ID_MEMBER = {$_POST['u']}\n\t\t\tAND is_activated = 1\n\t\t\tAND validation_code != ''\n\t\tLIMIT 1", __FILE__, __LINE__);
    // Does this user exist at all?
    if (mysql_num_rows($request) == 0) {
        fatal_lang_error('invalid_userid', false);
    }
    list($realCode, $username, $email) = mysql_fetch_row($request);
    mysql_free_result($request);
    // Is the password actually valid?
    require_once $sourcedir . '/Subs-Auth.php';
    $passwordError = validatePassword($_POST['passwrd1'], $username, array($email));
    // What - it's not?
    if ($passwordError != null) {
        fatal_lang_error('profile_error_password_' . $passwordError, false);
    }
    // Quit if this code is not right.
    if (empty($_POST['code']) || substr($realCode, 0, 10) != substr(md5($_POST['code']), 0, 10)) {
        fatal_error($txt['invalid_activation_code'], false);
    }
    // User validated.  Update the database!
    updateMemberData($_POST['u'], array('validation_code' => '\'\'', 'passwd' => '\'' . sha1(strtolower($username) . $_POST['passwrd1']) . '\''));
    if (isset($modSettings['integrate_reset_pass']) && function_exists($modSettings['integrate_reset_pass'])) {
        call_user_func($modSettings['integrate_reset_pass'], $username, $username, $_POST['passwrd1']);
    }
    loadTemplate('Login');
    $context += array('page_title' => &$txt['reminder_password_set'], 'sub_template' => 'login', 'default_username' => $username, 'default_password' => $_POST['passwrd1'], 'never_expire' => false, 'description' => &$txt['reminder_password_set']);
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:41,代码来源:Reminder.php


示例18: net2ftp_module_printBody

function net2ftp_module_printBody()
{
    // --------------
    // This function prints the login screen
    // --------------
    // -------------------------------------------------------------------------
    // Global variables
    // -------------------------------------------------------------------------
    global $net2ftp_settings, $net2ftp_globals, $net2ftp_messages, $net2ftp_result, $net2ftp_output;
    if (isset($_POST["troubleshoot_ftpserver"]) == true) {
        $troubleshoot_ftpserver = validateFtpserver($_POST["troubleshoot_ftpserver"]);
    } else {
        $troubleshoot_ftpserver = "";
    }
    if (isset($_POST["troubleshoot_ftpserverport"]) == true) {
        $troubleshoot_ftpserverport = validateFtpserverport($_POST["troubleshoot_ftpserverport"]);
    } else {
        $troubleshoot_ftpserverport = "";
    }
    if (isset($_POST["troubleshoot_username"]) == true) {
        $troubleshoot_username = validateUsername($_POST["troubleshoot_username"]);
    } else {
        $troubleshoot_username = "";
    }
    if (isset($_POST["troubleshoot_password"]) == true) {
        $troubleshoot_password = validatePassword($_POST["troubleshoot_password"]);
    } else {
        $troubleshoot_password = "";
    }
    if (isset($_POST["troubleshoot_directory"]) == true) {
        $troubleshoot_directory = validateDirectory($_POST["troubleshoot_directory"]);
    } else {
        $troubleshoot_directory = "";
    }
    if (isset($_POST["troubleshoot_passivemode"]) == true) {
        $troubleshoot_passivemode = validatePassivemode($_POST["troubleshoot_passivemode"]);
    } else {
        $troubleshoot_passivemode = "";
    }
    $troubleshoot_ftpserver_html = htmlEncode2($troubleshoot_ftpserver);
    $troubleshoot_ftpserverport_html = htmlEncode2($troubleshoot_ftpserverport);
    $troubleshoot_username_html = htmlEncode2($troubleshoot_username);
    $troubleshoot_directory_html = htmlEncode2($troubleshoot_directory);
    $troubleshoot_passivemode_html = htmlEncode2($troubleshoot_passivemode);
    // -------------------------------------------------------------------------
    // Variables for all screens
    // -------------------------------------------------------------------------
    // Title
    $title = __("Troubleshoot an FTP server");
    // Form name
    $formname = "AdvancedForm";
    // -------------------------------------------------------------------------
    // Variables for screen 1
    // -------------------------------------------------------------------------
    if ($net2ftp_globals["screen"] == 1) {
        // Next screen
        $nextscreen = 2;
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='advanced';document.forms['" . $formname . "'].screen.value='1';document.forms['" . $formname . "'].submit();";
        $forward_onclick = "document.forms['" . $formname . "'].submit();";
    } elseif ($net2ftp_globals["screen"] == 2) {
        // Back and forward buttons
        $back_onclick = "document.forms['" . $formname . "'].state.value='advanced_ftpserver'; document.forms['" . $formname . "'].submit();";
        // Initial checks
        if ($troubleshoot_passivemode != "yes") {
            $troubleshoot_passivemode = "no";
        }
        // Connect
        setStatus(1, 10, __("Connecting to the FTP server"));
        $conn_id = ftp_connect("{$troubleshoot_ftpserver}", $troubleshoot_ftpserverport);
        // Login with username and password
        setStatus(2, 10, __("Logging into the FTP server"));
        $ftp_login_result = ftp_login($conn_id, $troubleshoot_username, $troubleshoot_password);
        // Passive mode
        if ($troubleshoot_passivemode == "yes") {
            setStatus(3, 10, __("Setting the passive mode"));
            $ftp_pasv_result = ftp_pasv($conn_id, TRUE);
        } else {
            $ftp_pasv_result = true;
        }
        // Get the FTP system type
        setStatus(4, 10, __("Getting the FTP system type"));
        $ftp_systype_result = ftp_systype($conn_id);
        // Change the directory
        setStatus(5, 10, __("Changing the directory"));
        $ftp_chdir_result = ftp_chdir($conn_id, $troubleshoot_directory);
        // Get the current directory from the FTP server
        setStatus(6, 10, __("Getting the current directory"));
        $ftp_pwd_result = ftp_pwd($conn_id);
        // Try to get a raw list
        setStatus(7, 10, __("Getting the list of directories and files"));
        $ftp_rawlist_result = ftp_rawlist($conn_id, "-a");
        if (sizeof($ftp_rawlist_result) <= 1) {
            $ftp_rawlist_result = ftp_rawlist($conn_id, "");
        }
        // Parse the list
        setStatus(8, 10, __("Parsing the list of directories and files"));
        for ($i = 0; $i < sizeof($ftp_rawlist_result); $i++) {
            $parsedlist[$i] = ftp_scanline($troubleshoot_directory, $ftp_rawlist_result[$i]);
        }
//.........这里部分代码省略.........
开发者ID:jprice,项目名称:EHCP,代码行数:101,代码来源:advanced_ftpserver.inc.php



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP validateQueryString函数代码示例发布时间:2022-05-23
下一篇:
PHP validateMenuPriv函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap