/** * Set the Url */ public function setRequestUrl($url) { $this->request->setBaseUrl($this->config->webpath . 'index.php/' . $url); $this->request->setPathInfo('/' . $url); $this->request->setRequestUri('/' . $url); $this->request->setParam('csrfToken', Phprojekt::createCsrfToken()); }
/** * Returns the front configurations from the configuration.php (front.xxx), * and some others Core Settings. * * The return is an array like ('name' => varName, 'value' => varValue') * * The return is in JSON format. * * @return void */ public function jsonGetConfigurationsAction() { $fronVars = Phprojekt::getInstance()->getConfig()->front; $data = array(); if (null !== $fronVars) { foreach ($fronVars as $key => $value) { $data[] = array('name' => $key, 'value' => $value); } } // System info $data[] = array('name' => 'phprojektVersion', 'value' => Phprojekt::getVersion()); $data[] = array('name' => 'currentUserId', 'value' => Phprojekt_Auth::getUserId()); $data[] = array('name' => 'csrfToken', 'value' => Phprojekt::createCsrfToken()); Phprojekt_Converter_Json::echoConvert($data); }
/** * Returns the front configurations from the configuration.php (front.xxx), * and some others Core Settings. * * The return is an array like ('name' => varName, 'value' => varValue') * * The return is in JSON format. * * @return void */ public function jsonGetConfigurationsAction() { $fronVars = Phprojekt::getInstance()->getConfig()->front; $data = array(); if (null !== $fronVars) { foreach ($fronVars as $key => $value) { $data[] = array('name' => $key, 'value' => $value); } } $user = Phprojekt_Auth_Proxy::getEffectiveUser(); $settings = $user->settings->fetchAll(); $tutorialDisplayed = "false"; foreach ($settings as $setting) { if ($setting->keyValue == "tutorialDisplayed") { $tutorialDisplayed = $setting->value; break; } } // System info $data[] = array('name' => 'phprojektVersion', 'value' => Phprojekt::getVersion()); $data[] = array('name' => 'currentUserId', 'value' => $user->id); $data[] = array('name' => 'currentUserName', 'value' => $user->username); $data[] = array('name' => 'csrfToken', 'value' => Phprojekt::createCsrfToken()); $data[] = array('name' => 'tutorialDisplayed', 'value' => $tutorialDisplayed); Phprojekt_Converter_Json::echoConvert($data); }