本文整理汇总了PHP中Symfony\Component\HttpFoundation\Session\SessionInterface类的典型用法代码示例。如果您正苦于以下问题:PHP SessionInterface类的具体用法?PHP SessionInterface怎么用?PHP SessionInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SessionInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$duplicateName = false;
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$notebookSameName = $this->getRepository(Notebook::class)->getByName($session->get('user/id'), $name);
if ($notebookSameName) {
$duplicateName = true;
}
if (!$emptyName && !$duplicateName) {
$currentDate = Util::getServerCurrentDateTime();
$defaultFlag = 0;
// get the default notebook
$defaultNotebook = $this->getRepository(Notebook::class)->getDefaultByUserId($session->get('user/id'));
if (!$defaultNotebook) {
$defaultFlag = 1;
}
$notebookId = $this->getRepository(Notebook::class)->save($session->get('user/id'), $name, $description, $defaultFlag, $currentDate);
$this->getLogger()->addInfo('ADD QUICK NOTES notebook ' . $name, $this->getLoggerContext());
}
return new Response('');
}
示例2: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$Id = $request->get('id');
$resolutions = $this->getRepository(IssueSettings::class)->getAllIssueSettings('resolution', $session->get('client/id'));
return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/resolution/DeleteConfirm.php', get_defined_vars());
}
示例3: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$projectId = $request->get('id');
$project = $this->getRepository(YongoProject::class)->getById($projectId);
$emptyName = false;
$alreadyExists = false;
if ($request->request->has('confirm_new_release')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
$releasesDuplicate = $this->getRepository(YongoProject::class)->getVersionByName($projectId, $name);
if ($releasesDuplicate) {
$alreadyExists = true;
}
if (!$emptyName && !$alreadyExists) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(YongoProject::class)->addVersion($projectId, $name, $description, $currentDate);
$this->getLogger()->addInfo('ADD Project Version ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/project/versions/' . $projectId);
}
}
$menuSelectedCategory = 'project';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Project Version';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/project/version/Add.php', get_defined_vars());
}
示例4: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'system';
$emptyName = false;
$eventId = $request->get('id');
$event = $this->getRepository(IssueEvent::class)->getById($eventId);
if ($event['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
if ($request->request->has('edit_event')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
if (!$emptyName) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(IssueEvent::class)->updateById($eventId, $name, $description, $currentDate);
$this->getLogger()->addInfo('UPDATE Yongo Event ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/events');
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Event';
return $this->render(__DIR__ . '/../../../Resources/views/administration/event/edit.php', get_defined_vars());
}
示例5: indexAction
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: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$clientId = $session->get('client/id');
$loggedInUserId = $session->get('user/id');
$clientSettings = $session->get('client/settings');
} else {
$clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
$loggedInUserId = null;
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
}
$projectId = $request->get('id');
$month = $request->get('month');
$year = $request->get('year');
$project = $this->getRepository(YongoProject::class)->getById($projectId);
if ($project['client_id'] != $clientId) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$session->set('selected_project_id', $projectId);
$menuSelectedCategory = 'project';
$hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
$hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
$hasAdministerProjectsPermission = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_ADMINISTER_PROJECTS);
$hasAdministerProject = $hasGlobalSystemAdministrationPermission || $hasGlobalAdministrationPermission || $hasAdministerProjectsPermission;
$previousMonthName = date("F", mktime(0, 0, 0, $month - 1));
$currentMonthName = date("F", mktime(0, 0, 0, $month));
$nextMonthName = date("F", mktime(0, 0, 0, $month + 1));
$sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Calendar (due date)';
return $this->render(__DIR__ . '/../../Resources/views/project/ViewCalendar.php', get_defined_vars());
}
示例7: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$loggedInUserId = $session->get('user/id');
$clientId = $session->get('client/id');
$clientSettings = $session->get('client/settings');
} else {
$clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
$loggedInUserId = null;
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
}
$versionId = $request->get('id');
$version = $this->getRepository(YongoProject::class)->getVersionById($versionId);
$projectId = $version['project_id'];
$project = $this->getRepository(YongoProject::class)->getById($projectId);
if ($project['client_id'] != $clientId) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$menuSelectedCategory = 'project';
$sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Version: ' . $version['name'] . ' / Summary';
$issuesResult = $this->getRepository(Issue::class)->getByParameters(array('project' => $projectId, 'resolution' => array(-2), 'page' => 1, 'version' => array($versionId), 'issues_per_page' => 10), $loggedInUserId);
$issues = $issuesResult[0];
$issuesResultUpdatedRecently = $this->getRepository(Issue::class)->getByParameters(array('project' => $projectId, 'resolution' => array(-2), 'page' => 1, 'issues_per_page' => 10, 'sort' => 'updated', 'version' => array($versionId), 'sort_order' => 'desc'), $loggedInUserId);
$issuesUpdatedRecently = $issuesResultUpdatedRecently[0];
return $this->render(__DIR__ . '/../../Resources/views/project/ViewVersionSummary.php', get_defined_vars());
}
示例8: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$settings = $this->getRepository(UbirimiUser::class)->getYongoSettings($session->get('user/id'));
$countries = Util::getCountries();
return $this->render(__DIR__ . '/../../Resources/views/user/UpdatePreferencesConfirm.php', get_defined_vars());
}
示例9: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$clientYongoSettings = $this->getRepository(UbirimiClient::class)->getYongoSettings($session->get('client/id'));
$menuSelectedCategory = 'system';
return $this->render(__DIR__ . '/../../../Resources/views/administration/general_configuration/View.php', get_defined_vars());
}
示例10: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyName = false;
$allIssueTypes = $this->getRepository(IssueType::class)->getAll($session->get('client/id'));
if ($request->request->has('new_issue_type_screen_scheme')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
if (!$emptyName) {
$issueTypeScreenScheme = new IssueTypeScreenScheme($session->get('client/id'), $name, $description);
$currentDate = Util::getServerCurrentDateTime();
$issueTypeScreenSchemeId = $issueTypeScreenScheme->save($currentDate);
$issueTypes = $this->getRepository(IssueType::class)->getAll($session->get('client/id'));
while ($issueType = $issueTypes->fetch_array(MYSQLI_ASSOC)) {
$this->getRepository(IssueTypeScreenScheme::class)->addData($issueTypeScreenSchemeId, $issueType['id'], $currentDate);
}
$this->getLogger()->addInfo('ADD Yongo Issue Type Screen Scheme ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/screens/issue-types');
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Issue Type Screen Scheme';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/screen/issue_type_scheme/Add.php', get_defined_vars());
}
示例11: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$Id = $request->get('id');
$issueType = $this->getRepository(IssueType::class)->getById($Id);
if ($issueType['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$emptyName = false;
$typeExists = false;
if ($request->request->has('edit_type')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
if (empty($name)) {
$emptyName = true;
}
// check for duplication
$type = $this->getRepository(IssueSettings::class)->getByName($session->get('client/id'), 'type', mb_strtolower($name), $Id);
if ($type) {
$typeExists = true;
}
if (!$typeExists && !$emptyName) {
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(IssueType::class)->updateById($Id, $name, $description, $currentDate);
$this->getLogger()->addInfo('UPDATE Yongo Issue Type ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/issue-sub-tasks');
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Update Issue Type';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/type/Edit.php', get_defined_vars());
}
示例12: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$emptyPriorityName = false;
$priorityExists = false;
if ($request->request->has('new_priority')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$color = Util::cleanRegularInputField($request->request->get('color'));
if (empty($name)) {
$emptyPriorityName = true;
}
// check for duplication
$priority = $this->getRepository(IssueSettings::class)->getByName($session->get('client/id'), 'priority', mb_strtolower($name));
if ($priority) {
$priorityExists = true;
}
if (!$priorityExists && !$emptyPriorityName) {
$iconName = 'generic.png';
$currentDate = Util::getServerCurrentDateTime();
$this->getRepository(IssueSettings::class)->create('issue_priority', $session->get('client/id'), $name, $description, $iconName, $color, $currentDate);
$this->getLogger()->addInfo('ADD Yongo Issue Priority ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/issue/priorities');
}
}
$menuSelectedCategory = 'issue';
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Issue Priority';
return $this->render(__DIR__ . '/../../../../Resources/views/administration/issue/priority/Add.php', get_defined_vars());
}
示例13: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$loggedInUserId = $session->get('user/id');
$issueId = $request->request->get('id');
$timeSpentPost = trim(str_replace(" ", '', $request->request->get('time_spent')));
$dateStartedString = $request->request->get('date_started');
$remainingTime = $request->request->get('remaining');
$comment = $request->request->get('comment');
$dateStarted = \DateTime::createFromFormat('d-m-Y H:i', $dateStartedString);
$dateStartedString = date_format($dateStarted, 'Y-m-d H:i');
if (is_numeric($timeSpentPost)) {
$timeSpentPost = $timeSpentPost . $session->get('yongo/settings/time_tracking_default_unit');
}
if ($timeSpentPost) {
$currentDate = Util::getServerCurrentDateTime();
$issueQueryParameters = array('issue_id' => $issueId);
$issue = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId);
$this->getRepository(WorkLog::class)->addLog($issueId, $loggedInUserId, $timeSpentPost, $dateStartedString, $comment, $currentDate);
$remainingTime = $this->getRepository(WorkLog::class)->adjustRemainingEstimate($issue, $timeSpentPost, $remainingTime, $session->get('yongo/settings/time_tracking_hours_per_day'), $session->get('yongo/settings/time_tracking_days_per_week'), $loggedInUserId);
$fieldChanges = array(array('time_spent', null, $timeSpentPost), array('remaining_estimate', $issue['remaining_estimate'], $remainingTime));
$this->getRepository(Issue::class)->updateHistory($issue['id'], $loggedInUserId, $fieldChanges, $currentDate);
// update the date_updated field
$this->getRepository(Issue::class)->updateById($issueId, array('date_updated' => $currentDate), $currentDate);
$project = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
$issueEventData = array('user_id' => $loggedInUserId, 'comment' => $comment, 'date_started' => $dateStartedString, 'time_spent' => $timeSpentPost);
$issueEvent = new IssueEvent($issue, $project, IssueEvent::STATUS_UPDATE, $issueEventData);
UbirimiContainer::get()['dispatcher']->dispatch(YongoEvents::YONGO_ISSUE_WORK_LOGGED, $issueEvent);
}
if (null == $remainingTime || '' == $remainingTime) {
$remainingTime = -1;
}
return new Response($remainingTime);
}
示例14: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$entityId = $request->get('id');
if (Util::checkUserIsLoggedIn()) {
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
$loggedInUserId = $session->get('user/id');
$page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
if ($page) {
$spaceId = $page['space_id'];
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'] . ' / Attachments';
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
$settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
$documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
$page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
if ($page) {
$spaceId = $page['space_id'];
$spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
if (!($documentatorUseAnonymous && $spaceHasAnonymousAccess)) {
Util::signOutAndRedirect();
die;
}
}
$sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'] . ' / Attachments';
}
$menuSelectedCategory = 'documentator';
if ($page) {
$attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
}
return $this->render(__DIR__ . '/../../../Resources/views/page/attachment/View.php', get_defined_vars());
}
示例15: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
Util::checkUserIsLoggedInAndRedirect();
$menuSelectedCategory = 'issue';
$emptyName = false;
$fields = $this->getRepository(Field::class)->getByClient($session->get('client/id'));
if ($request->request->has('add_screen')) {
$name = Util::cleanRegularInputField($request->request->get('name'));
$description = Util::cleanRegularInputField($request->request->get('description'));
$currentDate = Util::getServerCurrentDateTime();
if (empty($name)) {
$emptyName = true;
}
if (!$emptyName) {
$screen = new Screen($session->get('client/id'), $name, $description);
$screenId = $screen->save($currentDate);
$order = 0;
foreach ($request->request as $key => $value) {
if (substr($key, 0, 6) == 'field_') {
$order++;
$fieldId = str_replace('field_', '', $key);
$this->getRepository(Screen::class)->addData($screenId, $fieldId, $order, $currentDate);
}
}
$this->getLogger()->addInfo('ADD Yongo Screen ' . $name, $this->getLoggerContext());
return new RedirectResponse('/yongo/administration/screens');
}
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Create Screen';
return $this->render(__DIR__ . '/../../../Resources/views/administration/screen/Add.php', get_defined_vars());
}