本文整理汇总了PHP中Ubirimi\Util::getHttpHost方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getHttpHost方法的具体用法?PHP Util::getHttpHost怎么用?PHP Util::getHttpHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ubirimi\Util
的用法示例。
在下文中一共展示了Util::getHttpHost方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
$clientSettings = $session->get('client/settings');
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
$loggedInUserId = null;
}
$spaceId = $request->get('space_id');
$space = $this->getRepository(Space::class)->getById($spaceId);
$menuSelectedCategory = 'documentator';
$space = $this->getRepository(Space::class)->getById($spaceId);
if ($space['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
$pages = $this->getRepository(Entity::class)->getAllBySpaceId($spaceId, 0);
$homePage = $this->getRepository(Entity::class)->getById($space['home_entity_id']);
if ($homePage['in_trash_flag']) {
$homePage = null;
}
$treeStructure = $this->getRepository(Space::class)->generateTreeStructure($pages, $space['home_entity_id']);
$pages->data_seek(0);
return $this->render(__DIR__ . '/../Resources/views/ListPages.php', get_defined_vars());
}
示例2: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if ($request->request->has('retrieve')) {
$errorNotInClientDomain = false;
$emailAddressNotExists = false;
$httpHOST = Util::getHttpHost();
$address = Util::cleanRegularInputField($request->request->get('address'));
$exists = Util::checkEmailAddressExistence($address);
if ($exists) {
$baseURL = Util::getHttpHost();
$userData = $this->getRepository(UbirimiUser::class)->getByEmailAddressAndBaseURL($address, $baseURL);
if ($userData) {
$password = Util::updatePasswordForUserId($userData['id']);
$event = new UbirimiEvent(array('email' => $address, 'password' => $password));
UbirimiContainer::get()['dispatcher']->dispatch(UbirimiEvents::PASSWORD_RECOVER, $event);
return new RedirectResponse('/recover-password/response');
} else {
$errorNotInClientDomain = true;
}
} else {
$emailAddressNotExists = true;
}
return $this->render(__DIR__ . '/../Resources/views/_passwordRecoverForm.php', get_defined_vars());
} else {
if ($request->request->has('go_back')) {
return new RedirectResponse('/');
}
}
}
示例3: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$Id = $request->get('id');
$loggedInUserId = $session->get('user/id');
$clientId = $session->get('client/id');
if (Util::checkUserIsLoggedIn()) {
$issue = $this->getRepository(Issue::class)->getById($Id, $loggedInUserId);
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $issue['project_code'] . '-' . $issue['nr'];
$clientSettings = $session->get('client/settings');
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
$issue = $this->getRepository(Issue::class)->getById($Id, $loggedInUserId);
$sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $issue['project_code'] . '-' . $issue['nr'];
}
$issueProject = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
if ($issueProject['client_id'] != $clientId) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$issueId = $issue['id'];
$components = $this->getRepository(IssueComponent::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id']);
$versionsAffected = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id'], Issue::ISSUE_AFFECTED_VERSION_FLAG);
$versionsTargeted = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id'], Issue::ISSUE_FIX_VERSION_FLAG);
$attachments = $this->getRepository(IssueAttachment::class)->getByIssueId($issueId);
$countAttachments = 0;
if ($attachments) {
$countAttachments = $attachments->num_rows;
}
return $this->render(__DIR__ . '/../../Resources/views/issue/Print.php', get_defined_vars());
}
示例4: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$loggedInUserId = null;
if (Util::checkUserIsLoggedIn()) {
$loggedInUserId = $session->get('user/id');
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Dashboard';
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Dashboard';
}
$type = $request->get('type');
$menuSelectedCategory = 'documentator';
if ($type == 'spaces') {
if (Util::checkUserIsLoggedIn()) {
$spaces = $this->getRepository(Space::class)->getByClientId($session->get('client/id'), 1);
} else {
$spaces = $this->getRepository(Space::class)->getByClientIdAndAnonymous($session->get('client/id'));
}
} else {
if ($type == 'pages') {
$pages = $this->getRepository(Entity::class)->getFavouritePagesByClientIdAndUserId($session->get('client/id'), $loggedInUserId);
}
}
return $this->render(__DIR__ . '/../Resources/views/Dashboard.php', get_defined_vars());
}
示例5: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$selectedProjectId = $session->get('selected_project_id');
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
$selectedProjectId = null;
}
if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_YONGO) {
$urlPrefix = '/yongo/project/';
$projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
} else {
$urlPrefix = '/helpdesk/customer-portal/project/';
$projectsMenu = $this->getRepository(UbirimiClient::class)->getProjects($session->get('client/id'), 'array', null, 1);
}
$selectedProjectMenu = null;
if ($selectedProjectId) {
$selectedProjectMenu = $this->getRepository(YongoProject::class)->getById($selectedProjectId);
}
$hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
$hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
return $this->render(__DIR__ . '/../../Resources/views/menu/Projects.php', get_defined_vars());
}
示例6: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$clientSettings = $session->get('client/settings');
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
$clientId = $session->get('client/id');
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$clientSettings = $this->getRepository(UbirimiClient::class)->getById($clientId);
$loggedInUserId = null;
$settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
$documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
$documentatorAnonymousViewUserProfiles = $settingsDocumentador['anonymous_view_user_profile_flag'];
if (!($documentatorUseAnonymous && $documentatorAnonymousViewUserProfiles)) {
Util::signOutAndRedirect();
die;
}
}
$userId = $request->get('id');
$user = $this->getRepository(UbirimiUser::class)->getById($userId);
if ($user['client_id'] != $clientId) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$menuSelectedCategory = 'documentator';
$activities = $this->getRepository(UbirimiUser::class)->getDocumentadorActivityStream($userId);
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $user['first_name'] . ' ' . $user['last_name'] . ' / Activity';
return $this->render(__DIR__ . '/../../Resources/views/user/Activity.php', get_defined_vars());
}
示例7: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$projectId = $request->get('id');
if (Util::checkUserIsLoggedIn()) {
$loggedInUserId = $session->get('user/id');
$clientId = $session->get('client/id');
$project = $this->getRepository(YongoProject::class)->getById($projectId);
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'];
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
$project = $this->getRepository(YongoProject::class)->getById($projectId);
$sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'];
}
$hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS, $loggedInUserId);
if ($project['client_id'] != $clientId || !$hasBrowsingPermission) {
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;
$menuProjectCategory = 'summary';
return $this->render(__DIR__ . '/../../Resources/views/project/ViewSummary.php', get_defined_vars());
}
示例8: 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());
}
示例9: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$signInError = null;
$httpHOST = Util::getHttpHost();
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettingsByBaseURL($httpHOST);
$clientId = $clientSettings['id'];
$client = $this->getRepository(UbirimiClient::class)->getById($clientId);
$sectionPageTitle = $client['company_name'] . ' - Welcome to Customer Portal';
return $this->render(__DIR__ . '/../../Resources/views/customer_portal/Index.php', get_defined_vars());
}
示例10: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
Util::checkUserIsLoggedInAndRedirect();
$spaces = $this->getRepository(Space::class)->getByClientId($session->get('client/id'));
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$spaces = $this->getRepository(Space::class)->getByClientIdAndAnonymous($clientId);
}
return $this->render(__DIR__ . '/../../Resources/views/menu/Documentador.php', get_defined_vars());
}
示例11: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$entityId = $request->get('id');
if (Util::checkUserIsLoggedIn()) {
$session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
$page = $this->getRepository(Entity::class)->getById($entityId, $session->get('user/id'));
if ($page) {
$spaceId = $page['space_id'];
}
$sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'];
} 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'];
}
$menuSelectedCategory = 'documentator';
if ($page) {
$parentEntityId = $page['parent_entity_id'];
$parentPage = null;
if ($parentEntityId) {
$parentPage = $this->getRepository(Entity::class)->getById($parentEntityId);
}
$revisionId = $request->attributes->has('rev_id') ? str_replace('/', '', $request->get('rev_id')) : null;
if ($revisionId) {
$revision = $this->getRepository(Entity::class)->getRevisionsByPageIdAndRevisionId($entityId, $revisionId);
}
$space = $this->getRepository(Space::class)->getById($spaceId);
if ($space['client_id'] != $session->get('client/id')) {
return new RedirectResponse('/general-settings/bad-link-access-denied');
}
$pagesInSpace = $this->getRepository(Entity::class)->getAllBySpaceId($spaceId);
$treeStructure = $this->getRepository(Space::class)->generateTreeStructure($pagesInSpace, $entityId);
$comments = $this->getRepository(EntityComment::class)->getComments($entityId, 'array');
$lastRevision = $this->getRepository(Entity::class)->getLastRevisionByPageId($entityId);
$childPages = $this->getRepository(Entity::class)->getChildren($entityId);
$pageFiles = $this->getRepository(Entity::class)->getFilesByEntityId($entityId);
$attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
}
return $this->render(__DIR__ . '/../../Resources/views/page/View.php', get_defined_vars());
}
示例12: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
$selectedProjectId = $session->get('selected_project_id');
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
$selectedProjectId = null;
}
$clientAdministratorFlag = $session->get('user/client_administrator_flag');
return $this->render(__DIR__ . '/../../Resources/views/menu/HelpDesk.php', get_defined_vars());
}
示例13: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
}
$projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
$projectsForBrowsing = array();
for ($i = 0; $i < count($projectsMenu); $i++) {
$projectsForBrowsing[$i] = $projectsMenu[$i]['id'];
}
$customFilters = $this->getRepository(IssueFilter::class)->getAllByUser($session->get('user/id'));
return $this->render(__DIR__ . '/../../Resources/views/menu/Filters.php', get_defined_vars());
}
示例14: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
if (Util::checkUserIsLoggedIn()) {
} else {
$httpHOST = Util::getHttpHost();
$clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
$loggedInUserId = null;
}
$issueId = $request->request->get('issue_id');
$projectId = $request->request->get('project_id');
$workLogs = $this->getRepository(WorkLog::class)->getByIssueId($issueId);
$hasEditOwnWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_EDIT_OWN_WORKLOGS, $session->get('user/id'));
$hasEditAllWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_EDIT_ALL_WORKLOGS, $session->get('user/id'));
$hasDeleteOwnWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_DELETE_OWN_WORKLOGS, $session->get('user/id'));
$hasDeleteAllWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_DELETE_ALL_WORKLOGS, $session->get('user/id'));
return $this->render(__DIR__ . '/../../../Resources/views/issue/log_work/View.php', get_defined_vars());
}
示例15: indexAction
public function indexAction(Request $request, SessionInterface $session)
{
$projectId = $request->request->get('id');
$loggedInUserId = $session->get('user/id');
$clientId = $session->get('client/id');
$client = $this->getRepository(UbirimiClient::class)->getById($clientId);
$clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
if (Util::checkUserIsLoggedIn()) {
$hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS, $loggedInUserId);
} else {
$loggedInUserId = null;
$httpHOST = Util::getHttpHost();
$hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS);
}
if ($hasBrowsingPermission) {
$helpDeskFlag = 0;
if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_HELP_DESK) {
$helpDeskFlag = 1;
}
$endDate = Util::getServerCurrentDateTime();
$startDate = date_sub(new \DateTime($endDate, new \DateTimeZone($clientSettings['timezone'])), date_interval_create_from_date_string('2 days'));
$historyList = null;
do {
$historyList = Util::getProjectHistory(array($projectId), $helpDeskFlag, null, date_format($startDate, 'Y-m-d'), $endDate);
if (null == $historyList && date_format($startDate, 'Y-m-d H:i:s') == $client['date_created']) {
break;
}
$startDate = date_sub($startDate, date_interval_create_from_date_string('2 days'));
$startDate->setTime(0, 0, 0);
if (date_format($startDate, 'Y-m-d') < $client['date_created']) {
$startDate = new \DateTime($client['date_created'], new \DateTimeZone($clientSettings['timezone']));
break;
}
} while ($historyList == null);
$historyData = array();
$userData = array();
while ($historyList && ($history = $historyList->fetch_array(MYSQLI_ASSOC))) {
$historyData[substr($history['date_created'], 0, 10)][$history['user_id']][$history['date_created']][] = $history;
$userData[$history['user_id']] = array('picture' => $history['avatar_picture'], 'first_name' => $history['first_name'], 'last_name' => $history['last_name']);
}
}
$index = 0;
return $this->render(__DIR__ . '/../../Resources/views/project/ViewActivityStream.php', get_defined_vars());
}