Forums

36 views
Skip to first unread message

PJ Losey

unread,
Jul 22, 2012, 10:33:03 AM7/22/12
to agile-too...@googlegroups.com
Was wondering if anyone has any experience in using agile toolkit and a forum together, weather its something like phpbb or something custom made.  Im wanting to redesign my league site (http://israleague.com) and do it in atk however the community side of my site relies heavily on forums.

Any help here is appreciated weather its in the forum of heres a good tutorial or hey try this :)   Thanks guys.  As i build this project i will learn more on atk and can give back to this community.

Romans Malinovskis

unread,
Jul 24, 2012, 4:08:32 AM7/24/12
to agile-too...@googlegroups.com
Hi PJ


 https://resourcecentre.realexpayments.com runs a integration of old agile toolkit version and phpbb. Here are some files which might be helpful.

That should be placed in your Auth class. Please review everything line-by-line as this might be outdated.



    public function loginOnForum($username, $password, $redirect=false) {
        global $db, $cache, $config, $template, $phpEx, $user, $phpbb_root_path, $auth;
        $this->startSession();
       
        if($user->data['is_registered']) {
                //User is already logged in
        } else {
            $login = $this->api->db->dsql()
                    ->table('User')
                    ->field('Name')
                    ->where('Email', $username)
                    ->do_getOne();
            $password = $this->encryptPassword($password);

            $result = $auth->login($login, $password);

            if ($result['status'] == LOGIN_SUCCESS) {
                $this->api->memorize('sid', append_sid('index.php'));
                $this->api->memorize('session_id', $user->session_id);
                $this->api->memorize('s_user_id', $user->data['user_id']);
                //User was successfully logged into phpBB
                if (!$redirect) {
                    $this->loginRedirect();
                }
            } else {
                //User's login failed
                return false;
            }  
        }  
    }


    private function logoutFromForum() {
        global $SID, $_SID, $db, $cache, $config, $template, $phpEx, $user, $phpbb_root_path;
        $this->startSession();

        $user->session_id = $this->api->recall('session_id');
        $user->data['user_id'] = $this->api->recall('s_user_id');
       
        $user->session_kill();
        $user->session_begin();
        $message = $user->lang['LOGOUT_REDIRECT'];
    }  


    function processLogin(){
        $this->memorizeOriginalURL();
       
        $form=$this->form=$this->api->add('FreeForm',null,'LoginMenu',array('login_form','_top'));
        if($form->isSubmitted()){
            if($this->verifyCredintials(
                $form->get('username'),
                $this->encryptPassword($form->get('password'))
            )){
                $this->loggedIn($form->get('username'),$this->encrypt($form->get('password')),
                    $form->get('memorize')=='Y');
                $this->memorize('info',$this->info);
                $this->generateToken();
               
                if (!$this->loginOnForum($form->get('username'), $form->get('password'))) {
                    $this->displayError($form);
                }
            } else {
                $this->displayError($form);
            }
        }
    }



    function logout() {
        $this->logoutFromForum();
        // Forces logout. This also cleans cookies
        $this->forget('info');
        setcookie($this->name."_username",null);
        setcookie($this->name."_password",null);
        session_destroy();
        $this->info=false;
            
        $this->logoutFromSupport();
            
        
        $this->api->redirect($this->api->getIndexPage());
    }       



Was wondering if anyone has any experience in using agile toolkit and a forum together, weather its something like phpbb or something custom made.  Im wanting to redesign my league site (http://israleague.com) and do it in atk however the community side of my site relies heavily on forums.

Any help here is appreciated weather its in the forum of heres a good tutorial or hey try this :)   Thanks guys.  As i build this project i will learn more on atk and can give back to this community.

--
FYI: If amount of emails you receive from this group is too much - switch to "Digest" mode. You'll receive no more than 1 email per day.
 
To post to this group, send email to
agile-too...@googlegroups.com
 
To unsubscribe and view archive:
http://groups.google.com/group/agile-toolkit-devel?hl=en
 
To download Agile Toolkit, visit:
http://agiletoolkit.org/

--
Need Agile Toolkit help? I am available for Freelance work!

My Latest Blog Post: Object Oriented MVC Web Programming



Reply all
Reply to author
Forward
0 new messages