コード例 #1
0
 /**
  * Save the translations in the session
  *
  * @param Translations $translations
  * @param string       $key
  * @return bool
  */
 public function save(Translations $translations, $key = self::DEFAULT_KEY)
 {
     $rawTranslations = $translations->getRawData();
     $this->session->set($key, $rawTranslations);
     $this->session->save();
     return true;
 }
コード例 #2
0
 /**
  * @param Task $task
  */
 private function markSkipped(Task $task)
 {
     if (!$this->session instanceof SessionInterface) {
         return;
     }
     $this->session->set($this->getSessionKey($task), true);
 }
コード例 #3
0
 /**
  * @param TokenInterface $token
  */
 private function setToken(TokenInterface $token)
 {
     $serializedToken = serialize($token);
     $this->session->set($this->sessionTokenVariable, $serializedToken);
     $this->session->save();
     $this->cookieSetter->setCookie($this->session->getName(), $this->session->getId());
 }
コード例 #4
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $clientId = $session->get('client/id');
     $session->set('selected_product_id', -1);
     $menuSelectedCategory = 'general_overview';
     $timezoneData = explode("/", $session->get('client/settings/timezone'));
     $timezoneContinent = $timezoneData[0];
     $timeZoneContinents = array('Africa' => 1, 'America' => 2, 'Antarctica' => 4, 'Arctic' => 8, 'Asia' => 16, 'Atlantic' => 32, 'Australia' => 64, 'Europe' => 128, 'Indian' => 256, 'Pacific' => 512);
     $timeZoneCountry = $timezoneData[1];
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     if ($request->request->has('update_configuration')) {
         $language = Util::cleanRegularInputField($request->request->get('language'));
         $timezone = Util::cleanRegularInputField($request->request->get('zone'));
         $titleName = Util::cleanRegularInputField($request->request->get('title_name'));
         $operatingMode = Util::cleanRegularInputField($request->request->get('mode'));
         $parameters = array(array('field' => 'title_name', 'value' => $titleName, 'type' => 's'), array('field' => 'operating_mode', 'value' => $operatingMode, 'type' => 's'), array('field' => 'language', 'value' => $language, 'type' => 's'), array('field' => 'timezone', 'value' => $timezone, 'type' => 's'));
         $this->getRepository(UbirimiClient::class)->updateProductSettings($clientId, 'client_settings', $parameters);
         $session->set('client/settings/language', $language);
         $session->set('client/settings/timezone', $timezone);
         return new RedirectResponse('/general-settings/view-general');
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / GeneralSettings Settings / Update';
     return $this->render(__DIR__ . '/../Resources/views/EditSettings.php', get_defined_vars());
 }
コード例 #5
0
ファイル: EditController.php プロジェクト: spiasecki/ubirimi
 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $smtpServerId = $request->get('id');
     $smtpServer = $this->getRepository(SMTPServer::class)->getById($smtpServerId);
     $session->set('selected_product_id', -1);
     $menuSelectedCategory = 'general_mail';
     $emptyName = false;
     $emptyFromAddress = false;
     $emptyEmailPrefix = false;
     $emptyHostname = false;
     if ($request->request->has('edit_smtp')) {
         $name = Util::cleanRegularInputField($request->request->get('name'));
         $description = Util::cleanRegularInputField($request->request->get('description'));
         $fromAddress = Util::cleanRegularInputField($request->request->get('from_address'));
         $emailPrefix = Util::cleanRegularInputField($request->request->get('email_prefix'));
         $protocol = Util::cleanRegularInputField($request->request->get('protocol'));
         $hostname = Util::cleanRegularInputField($request->request->get('hostname'));
         $port = Util::cleanRegularInputField($request->request->get('port'));
         $timeout = Util::cleanRegularInputField($request->request->get('timeout'));
         $tls = $request->request->has('tls') ? 1 : 0;
         $username = Util::cleanRegularInputField($request->request->get('username'));
         $password = Util::cleanRegularInputField($request->request->get('password'));
         $date = Util::getServerCurrentDateTime();
         $this->getRepository(SMTPServer::class)->updateById($smtpServerId, $name, $description, $fromAddress, $emailPrefix, $protocol, $hostname, $port, $timeout, $tls, $username, $password, $date);
         $this->getLogger()->addInfo('UPDATE SMTP Server ' . $name, $this->getLoggerContext());
         $session->set('client/settings/smtp', $this->getRepository(SMTPServer::class)->getById($smtpServerId));
         return new RedirectResponse('/general-settings/smtp-settings');
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / GeneralSettings Settings / Update SMTP Server Settings';
     return $this->render(__DIR__ . '/../../Resources/views/smtp/Edit.php', get_defined_vars());
 }
コード例 #6
0
ファイル: EditController.php プロジェクト: spiasecki/ubirimi
 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $menuSelectedCategory = 'system';
     $timeTrackingFlag = $session->get('yongo/settings/time_tracking_flag');
     $defaultTimeTracking = null;
     switch ($session->get('yongo/settings/time_tracking_default_unit')) {
         case 'w':
             $defaultTimeTracking = 'week';
             break;
         case 'd':
             $defaultTimeTracking = 'day';
             break;
         case 'h':
             $defaultTimeTracking = 'hours';
             break;
         case 'm':
             $defaultTimeTracking = 'minute';
             break;
     }
     if ($request->request->has('edit_time_tracking')) {
         $hoursPerDay = $request->request->get('hours_per_day');
         $daysPerWeek = $request->request->get('days_per_week');
         $defaultUnit = $request->request->get('default_unit');
         $this->getRepository(UbirimiClient::class)->updateTimeTrackingSettings($session->get('client/id'), $hoursPerDay, $daysPerWeek, $defaultUnit);
         $this->getLogger()->addInfo('UPDATE Yongo Time Tracking Settings', $this->getLoggerContext());
         $session->set('yongo/settings/time_tracking_hours_per_day', $hoursPerDay);
         $session->set('yongo/settings/time_tracking_days_per_week', $daysPerWeek);
         $session->set('yongo/settings/time_tracking_default_unit', $defaultUnit);
         return new RedirectResponse('/yongo/administration/issue-features/time-tracking');
     }
     return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/time_tracking/Edit.php', get_defined_vars());
 }
コード例 #7
0
 /**
  * Make user date and time settings sticky
  *
  * @param UserInterface $user
  * @param SessionInterface $session
  */
 protected function storeDateTimeSettingsInSession(UserInterface $user, SessionInterface $session)
 {
     $session->set('campaignchain.locale', $user->getLocale());
     $session->set('campaignchain.timezone', $user->getTimezone());
     $session->set('campaignchain.dateFormat', $user->getDateFormat());
     $session->set('campaignchain.timeFormat', $user->getTimeFormat());
 }
コード例 #8
0
 /**
  * @param \Symfony\Component\Form\FormView $view
  * @param \Symfony\Component\Form\FormInterface $form
  * @param array $options
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     if ($options['reload'] && !$options['as_url']) {
         throw new \InvalidArgumentException('GregwarCaptcha: The reload option cannot be set without as_url, see the README for more information');
     }
     $sessionKey = sprintf('gcb_%s', $form->getName());
     $isHuman = false;
     if ($options['humanity'] > 0) {
         $humanityKey = sprintf('%s_humanity', $sessionKey);
         if ($this->session->get($humanityKey, 0) > 0) {
             $isHuman = true;
         }
     }
     if ($options['as_url']) {
         $keys = $this->session->get($options['whitelist_key'], array());
         if (!in_array($sessionKey, $keys)) {
             $keys[] = $sessionKey;
         }
         $this->session->set($options['whitelist_key'], $keys);
         $options['session_key'] = $sessionKey;
     }
     $view->vars = array_merge($view->vars, array('captcha_width' => $options['width'], 'captcha_height' => $options['height'], 'reload' => $options['reload'], 'image_id' => uniqid('captcha_'), 'captcha_code' => $this->generator->getCaptchaCode($options), 'value' => '', 'is_human' => $isHuman));
     $persistOptions = array();
     foreach (array('phrase', 'width', 'height', 'distortion', 'length', 'quality', 'background_color', 'text_color') as $key) {
         $persistOptions[$key] = $options[$key];
     }
     $this->session->set($sessionKey, $persistOptions);
 }
コード例 #9
0
ファイル: SessionTokenStorage.php プロジェクト: ayoah/symfony
 /**
  * {@inheritdoc}
  */
 public function setToken($tokenId, $token)
 {
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
     $this->session->set($this->namespace . '/' . $tokenId, (string) $token);
 }
コード例 #10
0
ファイル: SecurityService.php プロジェクト: Mozan/Sylius
 /**
  * @param UserInterface $user
  */
 private function logInUser(UserInterface $user)
 {
     $token = new UsernamePasswordToken($user, $user->getPassword(), 'randomstringbutnotnull', $user->getRoles());
     $this->session->set($this->sessionTokenVariable, serialize($token));
     $this->session->save();
     $this->cookieSetter->setCookie($this->session->getName(), $this->session->getId());
 }
コード例 #11
0
 /**
  * {@inheritdoc}
  */
 public function onCheckoutComplete(GenericEvent $event)
 {
     /** @var OrderInterface $order */
     $order = $event->getSubject();
     Assert::isInstanceOf($order, OrderInterface::class);
     $this->session->set('sylius_order_id', $order->getId());
 }
コード例 #12
0
ファイル: CartSessionManager.php プロジェクト: raizeta/elcodi
 /**
  * Set Cart in session
  *
  * @param CartInterface $cart Cart
  *
  * @return $this Self object
  */
 public function set(CartInterface $cart)
 {
     if (!$this->saveInSession) {
         return $this;
     }
     $this->session->set($this->sessionFieldName, $cart->getId());
     return $this;
 }
コード例 #13
0
 /**
  * {@inheritdoc}
  */
 public function loadUserByOAuthUserResponse(UserResponseInterface $response)
 {
     $authProviderName = $response->getResourceOwner()->getName();
     $username = $response->getResponse()['login'];
     $this->session->set('owner', $authProviderName);
     $this->session->set('username', $username);
     return $this->loadUserByUsername($username);
 }
コード例 #14
0
 /**
  * Wordpress user login hook method
  *
  * @param WordpressEvent $event
  *
  * @see http://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
  */
 public function onLogin(WordpressEvent $event)
 {
     $wpUser = $event->getParameter('user');
     $user = $this->userManager->find($wpUser->data->ID);
     $user->setWordpressRoles($wpUser->roles);
     $token = new UsernamePasswordToken($user, $user->getPass(), 'secured_area', $user->getRoles());
     $this->securityContext->setToken($token);
     $this->session->set('token', $token);
 }
コード例 #15
0
 /**
  * {@inheritdoc}
  */
 protected function getId($create = TRUE)
 {
     if ($this->currentUser->isAuthenticated()) {
         return $this->currentUser->id();
     } elseif (!$this->session->has('uc_cart_id') && $create) {
         $this->session->set('uc_cart_id', md5(uniqid(rand(), TRUE)));
     }
     return $this->session->has('uc_cart_id') ? $this->session->get('uc_cart_id') : FALSE;
 }
コード例 #16
0
ファイル: Twitter.php プロジェクト: trismegiste/oauthbundle
 public function getAuthorizationUrl()
 {
     $temporaryCredentials = $this->provider->getTemporaryCredentials();
     // Store the credentials in the session.
     $this->session->set(self::TEMP_CRED, serialize($temporaryCredentials));
     // Second part of OAuth 1.0 authentication is to redirect the
     // resource owner to the login screen on the server.
     return $this->provider->getAuthorizationUrl($temporaryCredentials);
 }
コード例 #17
0
 /**
  * Wordpress user login hook method
  *
  * @param WordpressEvent $event
  *
  * @see http://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
  */
 public function onLogin(WordpressEvent $event)
 {
     $wpUser = $event->getParameter('user');
     $user = $this->userManager->find($wpUser->data->ID);
     $user->setWordpressRoles($wpUser->roles);
     $token = new UsernamePasswordToken($user, $user->getPass(), $this->firewall, $user->getRoles());
     $this->tokenStorage->setToken($token);
     $this->session->set('_security_' . $this->firewall, serialize($token));
 }
コード例 #18
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $clientId = $session->get('client/id');
     $loggedInUserId = $session->get('user/id');
     $issueId = $request->get('id');
     $issueQueryParameters = array('issue_id' => $issueId);
     $issue = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId);
     $projectId = $issue['issue_project_id'];
     $issueProject = $this->getRepository(YongoProject::class)->getById($projectId);
     // before going further, check to is if the issue project belongs to the client
     if ($clientId != $issueProject['client_id']) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_YONGO);
     if ($request->request->has('move_issue_step_3')) {
         $newIssueComponents = $request->request->get('new_component');
         $newIssueFixVersions = $request->request->get('new_fix_version');
         $newIssueAffectsVersions = $request->request->get('new_affects_version');
         if (array_key_exists('new_assignee', $_POST)) {
             $session->set('move_issue/new_assignee', $request->request->get('new_assignee'));
         }
         $session->set('move_issue/new_component', $newIssueComponents);
         $session->set('move_issue/new_fix_version', $newIssueFixVersions);
         $session->set('move_issue/new_affects_version', $newIssueAffectsVersions);
         return new RedirectResponse('/yongo/issue/move/confirmation/' . $issueId);
     }
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Move Issue - ' . $issue['project_code'] . '-' . $issue['nr'] . ' ' . $issue['summary'];
     $menuSelectedCategory = 'issue';
     $targetProjectId = $session->get('move_issue/new_project');
     $targetProjectComponents = $this->getRepository(YongoProject::class)->getComponents($targetProjectId);
     $targetVersions = $this->getRepository(YongoProject::class)->getVersions($targetProjectId);
     $issueComponents = $this->getRepository(IssueComponent::class)->getByIssueIdAndProjectId($issue['id'], $projectId);
     $issueFixVersions = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issue['id'], $projectId, Issue::ISSUE_FIX_VERSION_FLAG);
     $issueAffectedVersions = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issue['id'], $projectId, Issue::ISSUE_AFFECTED_VERSION_FLAG);
     $sourceAssignee = $issue['assignee'];
     $assignableUsersTargetProjectArray = $this->getRepository(YongoProject::class)->getUsersWithPermission($session->get('move_issue/new_project'), Permission::PERM_ASSIGNABLE_USER, 'array');
     $assigneeChanged = true;
     if ($sourceAssignee) {
         for ($i = 0; $i < count($assignableUsersTargetProjectArray); $i++) {
             if ($sourceAssignee == $assignableUsersTargetProjectArray[$i]['user_id']) {
                 $assigneeChanged = false;
                 break;
             }
         }
     }
     $actionTaken = false;
     if (($issueComponents || $issueFixVersions || $issueAffectedVersions) && ($targetProjectComponents || $targetVersions) || $assigneeChanged) {
         $actionTaken = true;
     }
     $newStatusName = $this->getRepository(IssueSettings::class)->getById($session->get('move_issue/new_status'), 'status', 'name');
     $newProject = $this->getRepository(YongoProject::class)->getById($session->get('move_issue/new_project'));
     $newProjectName = $newProject['name'];
     $newTypeName = $this->getRepository(IssueSettings::class)->getById($session->get('move_issue/new_type'), 'type', 'name');
     return $this->render(__DIR__ . '/../../../Resources/views/issue/move/MoveStep3.php', get_defined_vars());
 }
コード例 #19
0
 /**
  *
  * @param string $class 
  */
 public function setClass($class, $persist = false)
 {
     if (!in_array($class, $this->getClasses())) {
         throw new \LogicException(sprintf('Impossible to set the class discriminator, because the class "%s" is not present in the entities list', $class));
     }
     if ($persist) {
         $this->session->set(static::SESSION_NAME, $class);
     }
     $this->class = $class;
 }
コード例 #20
0
 public function requestNewOtp($phoneNumber)
 {
     /** @var SmsVerificationState|null $state */
     $state = $this->session->get($this->sessionKey);
     if (!$state) {
         $state = new SmsVerificationState($this->otpExpiryInterval, $this->otpRequestMaximum);
         $this->session->set($this->sessionKey, $state);
     }
     return $state->requestNewOtp($phoneNumber);
 }
コード例 #21
0
ファイル: CartSession.php プロジェクト: alexburrows/cream-2.x
 /**
  * {@inheritdoc}
  */
 public function deleteCartId($cart_id)
 {
     $ids = $this->session->get('commerce_cart_orders', []);
     $ids = array_diff($ids, [$cart_id]);
     if (!empty($ids)) {
         $this->session->set('commerce_cart_orders', $ids);
     } else {
         // Remove the empty list to allow the system to clean up empty sessions.
         $this->session->remove('commerce_cart_orders');
     }
 }
コード例 #22
0
ファイル: Session.php プロジェクト: andrewkrug/repucaution
 /**
  * Add or change data in the "userdata" array
  *
  * @param	mixed
  * @param	string
  */
 public function set_userdata($newdata = array(), $newval = '')
 {
     if (is_string($newdata)) {
         $newdata = array($newdata => $newval);
     }
     if (count($newdata) > 0) {
         foreach ($newdata as $key => $val) {
             $this->session->set($key, $val);
         }
     }
 }
コード例 #23
0
ファイル: SecurityService.php プロジェクト: Mangetsu/Sylius
 /**
  * {@inheritdoc}
  */
 public function logIn($email, $providerKey, Session $minkSession)
 {
     $user = $this->userRepository->findOneBy(['username' => $email]);
     if (null === $user) {
         throw new \InvalidArgumentException(sprintf('There is no user with email %s', $email));
     }
     $token = new UsernamePasswordToken($user, $user->getPassword(), $providerKey, $user->getRoles());
     $this->session->set('_security_user', serialize($token));
     $this->session->save();
     $minkSession->setCookie($this->session->getName(), $this->session->getId());
 }
コード例 #24
0
 /**
  * Authenticate against Squarespace
  */
 public function authenticate()
 {
     $crumb = $this->getCrumbVaue();
     try {
         $this->client->post('/api/auth/visitor/site', array('query' => ['crumb' => $crumb], 'exceptions' => true, 'cookies' => $this->jar, 'headers' => ['Content-Type' => 'application/json', 'Host' => $this->host, 'Origin' => $this->base_url], 'body' => json_encode(['password' => $this->password])));
         $this->session->set(static::COOKIE_JAR, $this->jar);
     } catch (\Exception $ex) {
         $this->logger->error($ex->getMessage());
         die($ex->getMessage());
     }
 }
コード例 #25
0
 /**
  * @param bool $hasCode
  * @param AuthenticateUserListener $callback
  * @return mixed
  */
 public function execute($hasCode, AuthenticateUserListener $callback)
 {
     if (!$hasCode) {
         return $this->getAuthorization();
     }
     $ghUser = $this->getGitHubUser();
     $user = $this->users->findByUsernameOrCreate($ghUser);
     $this->auth->login($user, true);
     $this->session->set('github.user', $ghUser);
     return $callback->userHasLoggedIn($user);
 }
コード例 #26
0
 /**
  * {@inheritDoc}
  */
 public function save(ResourceOwnerInterface $resourceOwner, $value, $type = 'token')
 {
     if ('token' === $type) {
         if (!isset($value['oauth_token'])) {
             throw new \InvalidArgumentException('Invalid request token.');
         }
         $key = $this->generateKey($resourceOwner, $value['oauth_token'], 'token');
     } else {
         $key = $this->generateKey($resourceOwner, is_array($value) ? current($value) : $value, $type);
     }
     $this->session->set($key, $value);
 }
コード例 #27
0
 /**
  * {@inheritdoc}
  */
 public function authenticate(TokenInterface $token, UserProviderInterface $userProvider)
 {
     $code = $token->getCredentials();
     $response = $this->guzzle->post(self::AUTH_TOKEN_URL, ['headers' => ['Accept' => 'application/json'], 'form_params' => ['client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'code' => $code, 'state' => $this->session->get(self::AUTH_STATE_KEY)]]);
     if ($response->getStatusCode() == 200) {
         $content = json_decode($response->getBody());
         $this->accessToken = $content->access_token;
         $this->loggedUser = $this->getLoggedUser();
         return $this->loggedUser->id;
     }
     $this->session->set(self::AUTH_STATE_KEY, null);
     return null;
 }
コード例 #28
0
 /**
  * @param array $scopes
  * @param null|string $redirectUri
  * @return RedirectResponse
  */
 public function start(array $scopes = null, $redirectUri = null)
 {
     $state = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
     $this->session->set(self::STATE_SESSION_KEY, $state);
     $params = array('client_id' => $this->clientId, 'state' => $state);
     if ($redirectUri) {
         $params['redirect_uri'] = $redirectUri;
     }
     if ($scopes) {
         $params['scope'] = implode(',', $scopes);
     }
     return new RedirectResponse('https://github.com/login/oauth/authorize?' . http_build_query($params));
 }
コード例 #29
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     Util::checkUserIsLoggedInAndRedirect();
     $loggedInUserId = $session->get('user/id');
     $filenameData = apache_request_headers();
     $filename = rawurldecode($filenameData['X_FILENAME']);
     $issueId = $request->request->get('issue_id');
     if (!$session->has('added_attachments_in_screen')) {
         $session->set('added_attachments_in_screen', array());
     }
     /* every attachment has its own dedicated sub-folder, so no editing on the upload filename will be done */
     if ($filename) {
         $ext = substr($filename, strrpos($filename, '.') + 1);
         $filenameWithoutExtension = substr($filename, 0, strrpos($filename, '.'));
         $attachmentId = $this->getRepository(IssueAttachment::class)->add($issueId, Util::slugify($filenameWithoutExtension) . '.' . $ext, $loggedInUserId, Util::getServerCurrentDateTime());
         if ($issueId == null) {
             $issueId = 'user_' . $loggedInUserId;
         }
         $uploadDirectory = Util::getAssetsFolder(SystemProduct::SYS_PRODUCT_YONGO) . $issueId;
         /* subfolders */
         $uploadDirSubfolder = $uploadDirectory . '/' . $attachmentId;
         if (!file_exists($uploadDirectory)) {
             mkdir($uploadDirectory);
         }
         if (!file_exists($uploadDirSubfolder)) {
             mkdir($uploadDirSubfolder);
         }
         $newFileName = $uploadDirSubfolder . '/' . Util::slugify($filenameWithoutExtension) . '.' . $ext;
         file_put_contents($newFileName, file_get_contents('php://input'));
         $size = filesize($newFileName);
         $temp = $session->get('added_attachments_in_screen');
         $temp[] = $attachmentId;
         $session->set('added_attachments_in_screen', $temp);
         $this->getRepository(IssueAttachment::class)->updateSizeById($attachmentId, $size);
         if (Util::isImage(Util::getExtension($filename))) {
             $thumbUploaddirSubfolder = $uploadDirSubfolder . '/thumbs';
             if (!file_exists($thumbUploaddirSubfolder)) {
                 mkdir($thumbUploaddirSubfolder);
             }
             $newThumbnailName = $thumbUploaddirSubfolder . '/' . Util::slugify($filenameWithoutExtension) . '.' . $ext;
             $image = new ZebraImage();
             $image->jpeg_quality = 100;
             $image->chmod_value = 0755;
             $image->source_path = $newFileName;
             $image->target_path = $newThumbnailName;
             $image->resize(150, 150, ZEBRA_IMAGE_CROP_CENTER);
         }
         return new JsonResponse($attachmentId);
     }
     return new Response('');
 }
コード例 #30
0
ファイル: SessionStore.php プロジェクト: realholgi/cmsable
 protected function purgeSessionCrumbs($crumbs)
 {
     if (!$this->hasStoredCrumbs()) {
         return;
     }
     $depth = $this->getDepth($crumbs);
     $storedArray = $this->getFromSession();
     $purgedArray = $this->removeIndexesFrom($storedArray, $depth);
     if (!$purgedArray) {
         $this->session->remove($this->sessionKey);
         return;
     }
     $this->session->set($this->sessionKey, $purgedArray);
 }