Example #1
1
 /**
  * Returns the current member based on the session id
  * @return Member
  */
 private function getCurrentMember()
 {
     if (!$this->currentMember && !($this->currentMember = Member::currentMember()->first())) {
         $this->currentMember = Member::create(['session_id' => \Session::getId()]);
     }
     return $this->currentMember;
 }
Example #2
0
 /**
  * Test session id regeneration.
  * @return void
  */
 public function testRegenerateId()
 {
     $this->session->start();
     $oldId = $this->session->getId();
     $this->session->regenerateId();
     $newId = $this->session->getId();
     $this->assertNotEquals($newId, $oldId);
 }
Example #3
0
 public function reGenerateSession()
 {
     $newSession = new Session();
     $newSession->setIpAddress($this->getIpAddress());
     $newSession->setStatus($this->getStatus());
     $newSession->setUser($this->getUser());
     $newSession->setShippingClass($this->getShippingClass());
     $newSession->setPaymentClass($this->getPaymentClass());
     $newSession->save();
     $_SESSION["ECommSessionId"] = $newSession->getId();
     return $newSession->getId();
 }
Example #4
0
 public function getIndex($option = null)
 {
     Session::put('curr_page', URL::full());
     $view = View::make('home');
     $view['sid'] = Session::getId();
     return $view;
 }
 public function __construct()
 {
     self::$url = 'https://www.google-analytics.com/collect';
     self::$version = '1';
     self::$trackingID = $_ENV['GOOGLE_TRACKING_CODE'];
     self::$clientID = Session::getId();
 }
Example #6
0
 public function beforeCreate()
 {
     $this->login_at = new Carbon();
     $this->ip = \Request::getClientIp();
     $this->session_id = \Session::getId();
     return true;
 }
Example #7
0
 public function recordLogout()
 {
     if ($oLogin = Login::lastLoginWithIpAndSession(\Request::getClientIp(), \Session::getId())->first()) {
         $oLogin->logout();
     }
     return true;
 }
Example #8
0
 public static function repoDecodeWeb($repo)
 {
     $ret = \Dcrypt\Aes::decrypt(base32_decode($repo), self::key . \Session::getId() . self::githubId());
     if ($ret === false) {
         \App::abort(500);
     }
     return $ret;
 }
 /**
  * Called by web server<br>
  * 生成并返回凭证。生成的凭证默认存储在Session里。<br>
  * 你可以改写该函数,存储在数据库、文件里、Memcache里都行。凭证数据结构也可以改。
  * @return array
  */
 public function outputCredential()
 {
     $token = str_random(40);
     $sessionId = \Session::getId();
     $credential = array(\Crypt::encrypt($sessionId), \Crypt::encrypt($token));
     \Session::put($this->tokenKey, $token);
     return $credential;
 }
Example #10
0
 public static function getValidFileValidatorFunction()
 {
     return function ($attribute, $value, $parameters) {
         $value = intval($value, 10);
         $file = File::find($value);
         return !is_null($file) && ($file->in_use || !is_null($file->session_id) && $file->session_id === Session::getId());
     };
 }
Example #11
0
 /**
  * To Trigger BEFORE Auth logout
  * 
  * Send Laravel's Session Id and User Id to server
  * via ZMQ before client's websocket connection
  * 
  * @return [type] [description]
  */
 public function sessionRemove()
 {
     $arr = ['session_id' => \Session::getId()];
     if (\Auth::check()) {
         $arr = ['session_id' => \Session::getId(), 'remove_id' => \Auth::id()];
     }
     \Larapush::sync($arr);
 }
 /**
  * @runInSeparateProcess
  */
 public function testSetAndGetAndRegenerateId()
 {
     Session::start();
     Session::setId('1ab2c3d4e5f6g7h8i9');
     $this->assertEquals('1ab2c3d4e5f6g7h8i9', Session::getId());
     Session::regenerateId();
     $this->assertNotEquals('1ab2c3d4e5f6g7h8i9', Session::getId());
 }
Example #13
0
 public function postNew()
 {
     $question = new Question();
     $question->title = Input::get('title');
     $question->question = Input::get('question');
     $question->answer = Input::get('answer');
     $question->last_session = Session::getId();
     $question->create_by = 1;
     //Sentry::getUser()->id;
     $question->view_count = 0;
     $question->is_visible = Input::get('is_visible', '1');
     $question->pin = Input::get('pin', '0');
     $question->save();
     return Redirect::to('faq');
 }
Example #14
0
 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postRegister(Request $request)
 {
     $validator = $this->validator($request->all());
     if ($validator->fails()) {
         $this->throwValidationException($request, $validator);
     }
     $user = $this->create($request->all());
     $previous_session = $user->session_id;
     if ($previous_session) {
         \Session::getHandler()->destroy($previous_session);
         Auth::setUser($user);
         Auth::logout();
     }
     Auth::login($user, $request->has('remember'));
     $user->session_id = \Session::getId();
     $user->save();
     return redirect($this->redirectPath());
 }
Example #15
0
 /**
  * Send the response after the user was authenticated.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  bool  $throttles
  * @return \Illuminate\Http\Response
  */
 protected function handleUserWasAuthenticated(Request $request, $throttles)
 {
     if ($throttles) {
         $this->clearLoginAttempts($request);
     }
     // if (method_exists($this, 'authenticated')) {
     //     return $this->authenticated($request, Auth::user());
     // }
     $user = Auth::getLastAttempted();
     $previous_session = $user->session_id;
     if ($previous_session) {
         \Session::getHandler()->destroy($previous_session);
         Auth::setUser($user);
         Auth::logout();
     }
     Auth::login($user, $request->has('remember'));
     $user->session_id = \Session::getId();
     $user->save();
     return redirect()->intended($this->redirectPath());
 }
Example #16
0
 public static function handler($data = null)
 {
     Session::init();
     $key = Cache::PREFIX . 'sessionReq_' . Session::getId();
     if (apc_exists($key)) {
         Session::setBatchVars(apc_fetch($key));
         apc_delete($key);
     }
     $ip = Session::getVar('ip');
     if (Session::isLoggedIn() && Session::getVar('lockToIP') && $ip != null && $ip != $_SERVER['REMOTE_ADDR']) {
         Session::destroy();
         header('Location: ' . Url::format('/'));
         die;
     }
     Session::setVar('ip', $_SERVER['REMOTE_ADDR']);
     $twitter = new twitter(ConnectionFactory::get('redis'));
     Layout::set('tweets', $twitter->getOfficialTweets());
     self::slowBan();
     self::errorBan();
 }
Example #17
0
 public function addList($data)
 {
     $products = trim(array_get($data, 'products'));
     $pages = trim(array_get($data, 'pages'));
     $fill = array_get($data, 'fill', []);
     $fill += ['users_id' => \Auth::id(), 'session_id' => \Session::getId(), 'name' => '[basket]'];
     if (!empty($data['checkboxes']['basket'])) {
         $fill['name'] = '[basket]';
     }
     preg_match_all("/^(.*)\$/m", trim($products), $p);
     if (isset($p[1]) && is_array($p[1])) {
         $this->saveAndAttachLists($p[1], 'product', $fill);
     }
     preg_match_all("/^(.*)\$/m", trim($pages), $pg);
     if (isset($pg[1]) && is_array($pg[1])) {
         $this->saveAndAttachLists($pg[1], 'page', $fill);
     }
     event('veer.message.center', trans('veeradmin.list.new'));
     return $this;
 }
Example #18
0
 public function index()
 {
     $this->load->language('api/login');
     $json = array();
     $this->load->model('account/api');
     // Login with API Key
     $api_info = $this->model_account_api->getApiByKey($this->request->post['key']);
     if ($api_info) {
         // Check if IP is allowed
         $ip_data = array();
         $results = $this->model_account_api->getApiIps($api_info['api_id']);
         foreach ($results as $result) {
             $ip_data[] = trim($result['ip']);
         }
         if (!in_array($this->request->server['REMOTE_ADDR'], $ip_data)) {
             $json['error']['ip'] = sprintf($this->language->get('error_ip'), $this->request->server['REMOTE_ADDR']);
         }
         if (!$json) {
             $json['success'] = $this->language->get('text_success');
             $session_name = 'temp_session_' . uniqid();
             $session = new Session();
             $session->start($this->session->getId(), $session_name);
             // Set API ID
             $session->data['api_id'] = $api_info['api_id'];
             // Create Token
             $json['token'] = $this->model_account_api->addApiSession($api_info['api_id'], $session_name, $session->getId(), $this->request->server['REMOTE_ADDR']);
         } else {
             $json['error']['key'] = $this->language->get('error_key');
         }
     }
     if (isset($this->request->server['HTTP_ORIGIN'])) {
         $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']);
         $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
         $this->response->addHeader('Access-Control-Max-Age: 1000');
         $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');
     }
     $this->response->addHeader('Content-Type: application/json');
     $this->response->setOutput(json_encode($json));
 }
 public function store()
 {
     $errors = false;
     /* @var $user \User */
     $user = User::where('email', '=', Input::get('email'))->first();
     // Check previous session for users.
     if ($user && $user->role == User::ROLE_USER) {
         if (!empty($user->session) && Session::getId() != $user->session && !$user->session_expires->isPast()) {
             $errors = true;
         }
     }
     if (!$errors) {
         $credentials = Input::only('email', 'password');
         $credentials['registration_status'] = 1;
         if (Auth::attempt($credentials)) {
             if (Auth::user()->role == "1") {
                 return Redirect::to('/user/admin/transactions/all');
             } else {
                 // Set user's session. Will expire in 5 min.
                 $user->session = Session::getId();
                 $sessionExpires = new Carbon();
                 $sessionExpires->addMinutes(5);
                 $user->session_expires = $sessionExpires;
                 $user->save();
                 // Redirect to user's profile when logged in first time.
                 if (!empty(Auth::user()->first_login)) {
                     return Redirect::to('/user/edit');
                 } else {
                     // Redirect to user's transactions.
                     return Redirect::to('/user/transactions');
                 }
             }
         }
     }
     Auth::logout();
     // TODO: Localize error message.
     return Redirect::to('/')->with('errorTitle', 'Login failed.')->with('error', 'Incorrect credentials. <a href="' . action('RemindersController@getRemind') . '">Forgot your password?</a>');
     // Message in popup.
 }
Example #20
0
 protected function send($verb, $url, $data, $secure)
 {
     $baseUri = $this->buildUrl($url, $secure);
     if (!empty($data) && $verb == 'GET') {
         $uri = $baseUri . '&' . http_build_query($data);
     } else {
         $uri = $baseUri;
     }
     $sessionId = \Session::getId();
     $ch = curl_init($uri);
     curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookiePath . 'jar_' . $sessionId . '.data');
     curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookiePath . 'jar_' . $sessionId . '.data');
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     switch ($verb) {
         case 'GET':
             curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
             break;
         case 'POST':
             curl_setopt($ch, CURLOPT_POST, TRUE);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
             break;
         case 'PUT':
             curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
             curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
             break;
         case 'DELETE':
             curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
             curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
             break;
     }
     $output = curl_exec($ch);
     if ($output == FALSE) {
         return curl_error($ch);
     }
     return json_decode($output, true);
 }
 public function login(Request $request)
 {
     $this->validate($request, [$this->loginUsername() => 'required', 'password' => 'required']);
     // If the class is using the ThrottlesLogins trait, we can automatically throttle
     // the login attempts for this application. We'll key this by the username and
     // the IP address of the client making these requests into this application.
     $throttles = $this->isUsingThrottlesLoginsTrait();
     if ($throttles && $this->hasTooManyLoginAttempts($request)) {
         return $this->sendLockoutResponse($request);
     }
     $credentials = $this->getCredentials($request);
     //  if (Auth::attempt($credentials, $request->has('remember'))) {
     //      $this->swapUserSession(Auth::user());
     //      return $this->handleUserWasAuthenticated($request, $throttles);
     //  }
     if (Auth::validate($credentials)) {
         $user = Auth::getLastAttempted();
         $previous_session = $user->last_session_id;
         if ($previous_session) {
             \Session::getHandler()->destroy($previous_session);
             Auth::setUser($user);
             Auth::logout();
         }
         Auth::login($user, $request->has('remember'));
         $user->last_session_id = \Session::getId();
         $user->save();
         return redirect()->intended($this->redirectPath());
     }
     // If the login attempt was unsuccessful we will increment the number of attempts
     // to login and redirect the user back to the login form. Of course, when this
     // user surpasses their maximum number of attempts they will get locked out.
     if ($throttles) {
         $this->incrementLoginAttempts($request);
     }
     return redirect()->back()->withInput($request->only($this->loginUsername(), 'remember'))->withErrors([$this->loginUsername() => $this->getFailedLoginMessage()]);
 }
Example #22
0
 public function index()
 {
     $this->load->language('api/login');
     // Delete old login so not to cause any issues if there is an error
     unset($this->session->data['api_id']);
     $keys = array('username', 'password');
     foreach ($keys as $key) {
         if (!isset($this->request->post[$key])) {
             $this->request->post[$key] = '';
         }
     }
     $json = array();
     $this->load->model('account/api');
     // Login with username and password
     $api_info = $this->model_account_api->login($this->request->post['username'], $this->request->post['password']);
     if ($api_info) {
         $json['success'] = $this->language->get('text_success');
         $sesion_name = 'temp_session_' . uniqid();
         $session = new Session();
         $session->start($sesion_name);
         $session->data['api_id'] = $api_info['api_id'];
         // Create Token
         $json['token'] = $this->model_account_api->addApiSession($api_info['api_id'], $sesion_name, $session->getId(), $this->request->server['REMOTE_ADDR']);
     } else {
         $json['error'] = $this->language->get('error_login');
     }
     if (isset($this->request->server['HTTP_ORIGIN'])) {
         $this->response->addHeader('Access-Control-Allow-Origin: ' . $this->request->server['HTTP_ORIGIN']);
         $this->response->addHeader('Access-Control-Allow-Credentials: true');
         $this->response->addHeader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
         $this->response->addHeader('Access-Control-Max-Age: 1000');
         $this->response->addHeader('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');
     }
     $this->response->addHeader('Content-Type: application/json');
     $this->response->setOutput(json_encode($json));
 }
Example #23
0
 public function up(Request $request)
 {
     $email = $request->get('email', null);
     $password = $request->get('password', null);
     $name = $request->get('name', null);
     $response = [];
     $usermodel = new \App\User();
     //        获取用户信息
     if ($user = $usermodel->getAuthIdentifier($email) == null) {
         $password = \Crypt::encrypt($password);
         $login_at = \Carbon\Carbon::now();
         $id = $usermodel->newUser(['name' => $name, 'password' => $password, 'email' => $email, 'role' => 5]);
         if ($id) {
             \Session::set('login_at', $login_at);
             \Session::set('email', $email);
             \Session::set('id', $id);
             \Session::set('name', $name);
             \Session::set('r', '5');
             $response['s'] = '1';
             $response['msg'] = '注册成功!';
             $response['name'] = \Session::get('name', null);
             //让laravel session 落地保存,拿到的session_id才是文件的名字之前都是缓存.
             \Session::save();
             $response['session_id'] = \Session::getId();
             if (\Session::getId() == $response['session_id']) {
                 die(json_encode($response));
             }
         }
     }
     $response['s'] = 0;
     $response['msg'] = '用户已存在!';
     \Session::clear();
     \Session::flush();
     session_write_close();
     die(json_encode($response));
 }
Example #24
0
    public function destruct($content = '')
    {
        static $called = false;
        if ($called == false && $this->_internal_request) {
            $called = true;
            $text = $this->_request_type != self::REQUEST_COMET ? ob_get_clean() : '';
            if (empty($text) && !empty($content)) {
                $text = $content;
            }
            if (!empty($this->result_ids)) {
                $result_ids = array();
                // get the matching ids
                foreach ($this->result_ids as $r_id) {
                    if (strpos($r_id, '*')) {
                        $clear_id = str_replace('*', '\\w+?', $r_id);
                        preg_match_all('/<[^>]*?id=(?:\'|")(' . $clear_id . '\\w*?)(?:\'|")[^>]*?>/isS', $text, $ids);
                        if (!empty($ids[1])) {
                            foreach ($ids[1] as $r_id2) {
                                $result_ids[] = $r_id2;
                            }
                        }
                    } else {
                        $result_ids[] = $r_id;
                    }
                }
                foreach ($result_ids as $r_id) {
                    if (strpos($text, ' id="' . $r_id . '">') !== false) {
                        $start = strpos($text, ' id="' . $r_id . '">') + strlen(' id="' . $r_id . '">');
                        $end = strpos($text, '<!--' . $r_id . '--></');
                        $this->assignHtml($r_id, substr($text, $start, $end - $start));
                        // Assume that all data should be put to div with this ID
                    } elseif ($this->_skip_result_ids_check == true) {
                        $this->assignHtml($r_id, $text);
                    }
                }
                if ($this->full_render && preg_match('/<title>(.*?)<\\/title>/s', $text, $m)) {
                    $this->assign('title', html_entity_decode($m[1], ENT_QUOTES));
                }
                // Fix for payment processor form, should be removed after payments refactoring
                if (Embedded::isEnabled() && empty($this->_result['html']) && $this->_skip_result_ids_check == false && !empty($text)) {
                    foreach ($this->result_ids as $r_id) {
                        $text .= '<script type="text/javascript">if (document.process) { document.process.target="_parent"; document.process.submit(); }</script>';
                        $this->assignHtml($r_id, $text);
                        break;
                    }
                }
                $text = '';
            }
            if (empty($this->_result['non_ajax_notifications'])) {
                $this->assign('notifications', fn_get_notifications());
            }
            if (Embedded::isEnabled()) {
                $this->assign('session_data', array('name' => Session::getName(), 'id' => Session::getId()));
            }
            if (!empty($this->anchor)) {
                $this->assign('anchor', $this->anchor);
            }
            // we call session saving directly
            session_write_close();
            // Prepare response
            $response = $this->_result;
            if (fn_string_not_empty($text)) {
                $response['text'] = trim($text);
            }
            $response = json_encode($response, JSON_UNESCAPED_UNICODE);
            if (!headers_sent()) {
                header(' ', true, 200);
                // force 200 header, because we still need to return content
                if (Embedded::isEnabled() || $this->_request_type == self::REQUEST_JSONP_POST) {
                    header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
                    // for IE cors
                }
            }
            if ($this->_request_type == self::REQUEST_XML) {
                // Return json object
                header('Content-type: ' . $this->_content_type . '; charset=' . CHARSET);
            } elseif ($this->_request_type == self::REQUEST_JSONP) {
                // Return jsonp object
                header('Content-type: ' . $this->_content_type . '; charset=' . CHARSET);
                $response = $this->callback . '(' . $response . ');';
            } elseif ($this->_request_type == self::REQUEST_JSONP_POST) {
                // Return jsonp object
                header("X-Frame-Options: ", true);
                $response = '<script type="text/javascript" src="' . Registry::get('config.current_location') . '/js/lib/jquery/jquery.min.js' . '"></script>
                             <script type="text/javascript" src="' . Registry::get('config.current_location') . '/js/lib/postmessage/jquery.ba-postmessage.js' . '"></script>
                             <script type="text/javascript">

                                var Tygh = {};
                                Tygh.$ = jQuery.noConflict(true);
                             </script>
                             <script type="text/javascript">Tygh.$.postMessage(
                                "' . fn_js_escape($response) . '",\'' . Embedded::getUrl() . '\');</script>';
            } else {
                // Return html textarea object
                $response = '<textarea>' . fn_html_escape($response) . '</textarea>';
            }
            fn_echo($response);
        }
    }
Example #25
0
});
$app->post('/', function (Request $request) use($app) {
    //O usuário é '*****@*****.**' e a senha é 'phprules'?
    if ('*****@*****.**' === $request->input('mail') && '27da247ac3132070bfe88338846955adf41955fc' === sha1($request->input('pass'))) {
        $md5 = md5(Session::getId());
        //Grava na sessão que o visitante é o apresentador
        Session::put('mode', 'presenter');
        Session::put('name', $request->input('name'));
        Session::put('nickname', '*****@*****.**');
        if (!\Cache::has($md5)) {
            $cache = [];
            $cache['mode'] = 'presenter';
            $cache['name'] = $request->input('name');
            $cache['nickname'] = '*****@*****.**';
            \Cache::forever($md5, $cache);
        }
    } else {
        $md5 = md5(Session::getId());
        Session::put('mode', 'participant');
        Session::put('name', $request->input('name'));
        Session::put('nickname', $request->input('mail'));
        if (!\Cache::has($md5)) {
            $cache = [];
            $cache['mode'] = 'participant';
            $cache['name'] = $request->input('name');
            $cache['nickname'] = $request->input('mail');
            \Cache::forever($md5, $cache);
        }
    }
    return redirect('/');
});
ini_set('memory_limit', '1024M');
require 'Session.php';
require 'DirectoryManager.php';
$session = new Session();
$directory = new DirectoryManager();
$session->init();
if (isset($_POST)) {
    /*************************************
     *** GET PICTURE ***
     ************************************/
    //Variables
    $path = (string) filter_input(INPUT_GET, 'path');
    $extension = (string) filter_input(INPUT_GET, 'extension');
    $type = (string) filter_input(INPUT_GET, 'type');
    //Set session and directory
    $id = $session->getId();
    //"/media/Temp/1234/1234.yyy"
    $simplePath = $path . $id . DIRECTORY_SEPARATOR . $id . '.' . $extension;
    //"C:/xxxx/media/Temp/1234"
    $basePath = (string) $_SERVER['DOCUMENT_ROOT'] . $path . $id;
    //"C:/xxxx/media/Temp/1234/1234.yyy"
    $baseFilename = (string) $basePath . DIRECTORY_SEPARATOR . $id . '.' . $extension;
    //Search inside "C:/xxxx/media/Temp/1234" directory
    $directory->setDirectoryIterator($basePath);
    //Get media
    $media = file_get_contents('php://input');
    $firstArray = array('\\', '/', '%5C');
    $secondArray = array('/', '/', '/');
    //Format strings
    $baseFilename = str_replace($firstArray, $secondArray, $baseFilename);
    $simplePath = str_replace($firstArray, $secondArray, $simplePath);
Example #27
0
 protected function write(array $record)
 {
     $data = ['channel' => $record['channel'], 'message' => $record['message'], 'level' => $record['level'], 'level_name' => $record['level_name'], 'context' => json_encode($record['context']), 'remote_addr' => isset($_SERVER['REMOTE_ADDR']) ? ip2long($_SERVER['REMOTE_ADDR']) : null, 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null, 'session_id' => \Session::getId(), 'created_by' => \Auth::id(), 'created_at' => $record['datetime']->format('Y-m-d H:i:s')];
     DB::connection()->table($this->table)->insert($data);
 }
Example #28
0
 */
Route::get('office/merchant/payments', 'OfficeController@View_Merchant3');
Route::get('office/merchant/payments/{file}', 'OfficeController@View_Merchant3');
Route::get('office/merchant/payments/process/', 'OfficeController@View_MerchantProcess');
Route::get('office/merchant/payments/process/{file}', 'OfficeController@View_MerchantProcess');
Route::get('office/merchant/payments/progress/{file}', 'OfficeController@ViewMerchantProgress');
Route::get('office/progressbar/{file}', 'OfficeController@ViewMerchantProgress');
Route::post('office/merchant/payments/save', 'OfficeController@Post_Merchant3');
Route::post('office/merchant/payments/save/{file}', 'OfficeController@Post_Merchant3');
Route::post('office/merchant/save/ltf', 'OfficeController@Post_Merchant_LFT_SaveFormData');
Route::get('office/editfile', 'OfficeController@View_EditDocument');
Route::post('office/editfile', 'OfficeController@Post_EditFile');
## Cart is pending, no changes can be made yet.
Route::get('/step4services', 'ClientController@Step4Services');
Route::get('/IsDocumentOwner', 'ClientController@Ajax_Check_If_Document_Owner');
Route::get('/ajaxcheckpayment/' . Session::getId(), 'ClientController@AjaxCheckPaymentUpdate');
Route::post('/save_cart_items', 'ClientController@UpdateCartItems');
//Route::get('/upgradeonly', 'ClientController@ProcessPayments');
Route::post('/disclosuref', 'ClientController@DisclosureForm');
Route::get('/privacypolicy', 'ClientController@privacypolicy');
Route::get('/UpdateClientDocument', 'ClientController@UpdateClientDocument');
Route::get('/', 'DiyappController@View_Homepage');
Route::get('/{step}/', 'DiyappController@View_Edit_Step');
//Route::get('step1', 'ClientController@Step1');
//Route::get('step2', 'ClientController@Step2');
//Route::get('step3', 'ClientController@Step3');
//Route::get('step4', 'ClientController@Step4Services');
//Route::get('step5', 'ClientController@Step5');
//Route::get('step6', 'ClientController@Step6');
//Route::get('step7', 'ClientController@Step7');
Route::post('newclientform', 'ClientController@NewClientPosted');
Example #29
0
 /**
  * Exclude object from result
  *
  * @param   Session $session Object to remove from the list of results
  *
  * @return SessionQuery The current query, for fluid interface
  */
 public function prune($session = null)
 {
     if ($session) {
         $this->addUsingAlias(SessionPeer::ID, $session->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #30
0
    if (!$basket) {
        $basket = new Basket();
        $basket->price = 0;
        $basket->productCount = 0;
        $basket->status = Basket::STATUS_UNPAYED;
        $basket->date = date('Y-m-d H:i:s');
        $basket->sessionId = Session::getId();
        $basket->save();
    }
    // find prodcudt
    $product = Product::find(Input::get('id'));
    // add product to pasket products
    $bp = new BasketProduct();
    $bp->basketId = $basket->id;
    $bp->productId = $product->id;
    $bp->count = Input::get('count');
    $bp->price = $product->price;
    $bp->save();
    //
    $row = DB::table('basket_product')->select(DB::raw('SUM(price) as p'), DB::raw('SUM(count) as c'))->where('basketId', '=', $basket->id)->first();
    //
    $basket->price = $row->p;
    $basket->productCount = $row->c;
    $basket->save();
    //
    return ['cost' => $row->p, 'count' => $row->c];
}]);
Route::get('basket/product-list', ['as' => 'basket.list', function () {
    $basket = Basket::where('sessionId', '=', Session::getId())->first();
    return View::make('basket.list')->with('basket', $basket);
}]);