Exemplo n.º 1
0
function perch_members_init()
{
    perch_members_recover_session();
    perch_members_check_page_access();
}
Exemplo n.º 2
0
if (!defined('PERCH_MEMBERS_COOKIE')) {
    define('PERCH_MEMBERS_COOKIE', 'p_m');
}
include 'PerchMembers_Auth.class.php';
include 'PerchMembers_Authenticator.class.php';
include 'PerchMembers_Session.class.php';
include 'PerchMembers_Template.class.php';
include 'PerchMembers_Members.class.php';
include 'PerchMembers_Member.class.php';
include 'PerchMembers_Forms.class.php';
include 'PerchMembers_Form.class.php';
include 'PerchMembers_Tags.class.php';
include 'PerchMembers_Tag.class.php';
PerchSystem::register_template_handler('PerchMembers_Template');
perch_members_recover_session();
perch_members_check_page_access();
function perch_members_form_handler($SubmittedForm)
{
    if ($SubmittedForm->validate()) {
        $API = new PerchAPI(1.0, 'perch_members');
        switch ($SubmittedForm->formID) {
            case 'login':
                $PerchMembers_Auth = new PerchMembers_Auth($API);
                if (!$PerchMembers_Auth->handle_login($SubmittedForm)) {
                    $SubmittedForm->throw_error('login');
                }
                break;
            case 'profile':
                $Session = PerchMembers_Session::fetch();
                if ($Session->logged_in && $Session->get('token') == $SubmittedForm->data['token']) {
                    $Members = new PerchMembers_Members($API);