Пример #1
0
    public function forgot()
    {
        $node = pathang::getInstance('node');
        $request = pathang::getInstance('request');
        $basket = pathang::getInstance('basket');
        $email = $request->filterHTMLSQL('email');
        $password = $request->filterHTMLSQL('password');
        $n3 = $node->get('n3');
        pathang::getInstance('pathang')->SITE->PAGE = 'login';
        if ($email) {
            $code = pathang::getModel('userlog')->setForgotCode($email);
            if ($code == 2) {
                $basket->set('heading', 'Error in Operation');
                $basket->set('message', 'There is an error in the operation performed.
						Please redo the process.');
            } elseif ($code == 3) {
                $basket->set('heading', 'Email Not Found');
                $basket->set('message', 'Email you have provided is not registered with our
					database.Please enter the correct email id and redo the process.');
            } else {
                $basket->set('heading', 'Reset Password Email');
                $basket->set('message', 'Password reset instructions has been sent to your email. Follow
					the instructions in the mail to create a new password. Please check your spam box
					if in case you dont recieve a mail.');
                //echo $code;
                pathang::getHelper('userlog')->sendForgotPasswordMail($code, $email);
            }
            pathang::Render('userlog', 'forgot_message');
        } elseif ($n3) {
            if ($password) {
                $update = pathang::getModel('userlog')->updateForgotPassword($n3, $password);
                if ($update == 1) {
                    $basket->set('heading', 'Successfully Updated Password');
                    $basket->set('message', 'Your password has been successfully updated.Please
						login to enter the site');
                } else {
                    $basket->set('heading', 'Error in Operation');
                    $basket->set('message', 'There is an error in the operation performed.
						Please redo the process.');
                }
                pathang::Render('userlog', 'forgot_message');
            } else {
                pathang::render('userlog', 'reset_password');
            }
        } else {
            pathang::getInstance('pathang')->SITE->PAGE = 'login';
            pathang::render('userlog', 'forgot');
        }
    }
Пример #2
0
 public function notifications()
 {
     $basket = pathang::getInstance('basket');
     $request = pathang::getInstance('request');
     $snippet = $request->get('snippet');
     $user = pathang::getInstance('node')->get('n1');
     $limit = pathang::GetInstance('pathang')->FEEDSTACK->NOTIFICATION_CENTER_COUNT;
     if ($request->get('limit')) {
         $limit = $request->get('limit');
     }
     $liveuser = null;
     if (pathang::getInstance('session')->get('liveuser')) {
         $liveuser = pathang::getInstance('session')->get('liveuser')->username;
         $uid = pathang::getInstance('session')->get('liveuser')->id;
     }
     if ($user == $liveuser) {
         $notify = pathang::getModel('profile')->getUserNotifications($user, $limit);
         $notifyObj = new stdclass();
         if (isset($notify)) {
             foreach ($notify as $a => $b) {
                 $notifyTemp = new stdClass();
                 foreach ($b as $c => $d) {
                     $notifyTemp->{$c} = $d;
                 }
                 $notifyTemp->time_stamp = pathang::getHelper('feedprocess')->ago($notifyTemp->time_stamp);
                 $notifyObj->{$a} = $notifyTemp;
             }
         }
         $notifyTemp2 = new stdclass();
         $notifyTemp2->unread = pathang::GetModel('profile')->getUnreadNotificationCount($uid);
         $notifyTemp2->messages = $notifyObj;
         if ($snippet) {
             return $notifyTemp2;
         }
         $basket->set('notify', $notifyObj);
         pathang::getInstance('pathang')->SITE->PAGE = 'members';
         pathang::render('profile', 'notifications');
         //update notifacations read
         pathang::GetModel('profile')->updateReadNotifications($uid);
     } else {
         pathang::getInstance('pathang')->SITE->PAGE = 'login';
         $basket->set('heading', 'Restricted Access');
         $basket->set('message', 'You dont have enough permission to access this page.');
         pathang::render('general', 'errorpage');
         exit;
     }
 }
Пример #3
0
 public function deleteComment()
 {
     $request = pathang::getInstance('request');
     $comment_id = $request->get('comment_id');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     pathang::getModel('feed')->deleteFeedComment($comment_id);
     return 1;
 }
Пример #4
0
 public function deleteUser()
 {
     $request = pathang::GetInstance('request');
     $uid = $request->get('uid');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     $status = pathang::GetModel('userlog')->deleteUser($uid);
     if ($status) {
         echo '1';
     } else {
         echo '0';
     }
 }
Пример #5
0
 public function notify()
 {
     $request = pathang::GetInstance('request');
     $target = $request->get('target');
     $agent = $request->get('agent');
     $action = $request->get('action');
     $uid = $request->get('uid');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     pathang::getModel('usermain')->saveNotification($uid, $agent, $target, $action);
 }