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


PHP Access::create_hash方法代码示例

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


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

示例1: elseif

                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <?php 
        require 'footer.php';
        die;
    } else {
        Gadget::redirect('index');
        die;
    }
} elseif (isset($_REQUEST['submit_new_pass'])) {
    // Insert new password and set expires to 0
    $request = dbi()->q_1("SELECT * FROM password_reset_requests WHERE token_id = '" . $_SESSION['token_id'] . "'");
    dbi()->update('Customers', array('Password' => Access::create_hash($_REQUEST['new_pass'], 'strong')), 'CustomerID = ' . $request->CustomerID);
    dbi()->update('password_reset_requests', array('expires' => '0000-00-00 00:00:00'), 'token_id = \'' . $_SESSION['token_id'] . '\'');
    unset($_SESSION['token_id']);
    Gadget::add_message('Your password has been reset!');
    Gadget::redirect('login');
    die;
}
require 'header.php';
?>
<div class="content-padding">
    <form name="forgot-form" class="user-form" id="forgot-form" action="forgot" method="post">
        <table>
            <tr>
                <td>
                    <label for="forgot-email">email:</label>
                </td>
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:forgot.php

示例2: set_password

 public function set_password($new_pass)
 {
     $this->Password = Access::create_hash($new_pass, 'strong');
     $this->update();
 }
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:5,代码来源:customer.class.php

示例3: array

            'one_of'   => array($password),
        ),
        array(
            'name'     => 'Zip',
            'value'    => $zip,
            'required' => true,
            'match'    => '/^[0-9]{5}$/',
        ),
    ));

    if($validation->errors){
        Gadget::add_message($validation->get_errors());
    }else{
        $insert_data = array(
            'Email'    => $email,
            'Password' => Access::create_hash($password, 'strong'),
            'DeliveryZip' => $zip
        );
        $dbi->insert('Customers', $insert_data);
        if($dbi->errno == 1062){
            Gadget::add_message('This email address is already registered.');
        }else{
            Gadget::add_message('Your account has been created.');
            Gadget::redirect('login');
        }
    }
}

require 'header.php';
?>
<div class="content-padding">
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:register.php

示例4: json_encode

                        echo json_encode(array('result' => true, 'msg' => 'Successfully Logged In', 'extra' => json_encode($customer)));
                        break;
                    case 1:
                        echo json_encode(array('result' => false, 'msg' => "Incorrect Password"));
                        break;
                    case 2:
                        echo json_encode(array('result' => false, 'msg' => "Invalid Email"));
                        break;
                }
            } else {
                echo json_encode(array('result' => false, 'msg' => "Invalid username or password."));
            }
            break;
        case 'register':
            if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) {
                $insert_data = array('Email' => $_REQUEST['user'], 'Password' => Access::create_hash($_REQUEST['pass'], 'strong'));
                $dbi->insert('Customers', $insert_data);
                Access::log_user_in_ajax($_REQUEST['user'], $_REQUEST['pass']);
                echo json_encode(array('result' => true, 'msg' => "Your account has been created", 'extra' => Customer::get_current()));
            } else {
                echo json_encode(array('result' => false, 'msg' => "Invalid email or password"));
            }
            break;
        default:
            $_SESSION['loggedin'] = false;
            echo json_encode(array('result' => false, 'code' => '1', 'msg' => "Requested action not defined"));
            break;
    }
} else {
    echo json_encode(array('result' => false, 'msg' => "Error: No action was defined."));
}
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:31,代码来源:requests.php

示例5: debug

require 'includes/global.inc.php';
debug(0, 0, 0);
$page = Page::get_from_alias('register');
$page->add_js('js/register.js');
if ($_POST) {
    $email = strtolower(trim($_POST['register-email']));
    $password = $_POST['register-password'];
    $password2 = $_POST['confirm-password'];
    $zip = $_POST['register-zip'];
    $validation = new Validation();
    $validation->validate_array(array(array('name' => 'Email', 'value' => $email, 'match' => '/^[A-Z0-9._%+-]+\\@[A-Z0-9.-]+\\.[A-Z]{2,4}(\\.[A-Z]{2,4})?$/i', 'required' => true), array('name' => 'Password', 'value' => $password, 'required' => true), array('name' => 'Password Confirmation', 'value' => $password2, 'required' => true, 'one_of' => array($password)), array('name' => 'Zip', 'value' => $zip, 'required' => true, 'match' => '/^[0-9]{5}$/')));
    if ($validation->errors) {
        Gadget::add_message($validation->get_errors());
    } else {
        $insert_data = array('Email' => $email, 'Password' => Access::create_hash($password, 'strong'), 'DeliveryZip' => $zip);
        $dbi->insert('Customers', $insert_data);
        if ($dbi->errno == 1062) {
            Gadget::add_message('This email address is already registered.');
        } else {
            Gadget::add_message('Your account has been created.');
            Gadget::redirect('login');
        }
    }
}
require 'header.php';
?>
<div class="content-padding">
    <form class="user-form" name="register-form" id="register-form" action="register" method="post" onsubmit="return validateForm();">
        <table>
            <tr>
开发者ID:elliecm,项目名称:MadisonandRayne,代码行数:30,代码来源:register.php


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