本文整理汇总了PHP中OC_Util::getDefaultPageUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Util::getDefaultPageUrl方法的具体用法?PHP OC_Util::getDefaultPageUrl怎么用?PHP OC_Util::getDefaultPageUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Util
的用法示例。
在下文中一共展示了OC_Util::getDefaultPageUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->request = \OC::$server->getRequest();
$this->config = \OC::$server->getSystemConfig();
$this->redirectUrl = $this->request->getRequestUri();
$this->defaultPageUrl = \OC_Util::getDefaultPageUrl();
$this->visitPort = (int) $_SERVER["SERVER_PORT"];
if ($this->config->getValue("sso_multiple_region")) {
array_push(self::$requiredKeys, "sso_owncloud_url");
array_push(self::$requiredKeys, "sso_regions");
}
foreach ($this->necessaryImplementationClass as $class) {
if (!class_exists($class)) {
throw new Exception("The class " . $class . " did't exist.");
}
}
self::checkKeyExist(self::$requiredKeys);
RequestManager::init($this->config->getValue("sso_portal_url"), $this->config->getValue("sso_requests"));
}
示例2: testDefaultApps
/**
* Test default apps
*
* @dataProvider defaultAppsProvider
*/
function testDefaultApps($defaultAppConfig, $expectedPath, $enabledApps)
{
$oldDefaultApps = \OCP\Config::getSystemValue('core', 'defaultapp', '');
// CLI is doing messy stuff with the webroot, so need to work it around
$oldWebRoot = \OC::$WEBROOT;
\OC::$WEBROOT = '';
Dummy_OC_App::setEnabledApps($enabledApps);
\OCP\Config::setSystemValue('defaultapp', $defaultAppConfig);
$this->assertEquals('http://localhost/' . $expectedPath, \OC_Util::getDefaultPageUrl());
// restore old state
\OC::$WEBROOT = $oldWebRoot;
Dummy_OC_App::restore();
\OCP\Config::setSystemValue('defaultapp', $oldDefaultApps);
}
示例3: testShowLoginFormForLoggedInUsers
public function testShowLoginFormForLoggedInUsers()
{
$this->userSession->expects($this->once())->method('isLoggedIn')->willReturn(true);
$expectedResponse = new RedirectResponse(\OC_Util::getDefaultPageUrl());
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', '', ''));
}
示例4: showLoginForm
/**
* @PublicPage
* @NoCSRFRequired
* @UseSession
*
* @param string $user
* @param string $redirect_url
* @param string $remember_login
*
* @return TemplateResponse
*/
public function showLoginForm($user, $redirect_url, $remember_login)
{
if ($this->userSession->isLoggedIn()) {
return new RedirectResponse(\OC_Util::getDefaultPageUrl());
}
$parameters = array();
$loginMessages = $this->session->get('loginMessages');
$errors = [];
$messages = [];
if (is_array($loginMessages)) {
list($errors, $messages) = $loginMessages;
}
$this->session->remove('loginMessages');
foreach ($errors as $value) {
$parameters[$value] = true;
}
$parameters['messages'] = $messages;
if (!is_null($user) && $user !== '') {
$parameters['loginName'] = $user;
$parameters['user_autofocus'] = false;
} else {
$parameters['loginName'] = '';
$parameters['user_autofocus'] = true;
}
if (!empty($redirect_url)) {
$parameters['redirect_url'] = $redirect_url;
}
$parameters['canResetPassword'] = true;
if (!$this->config->getSystemValue('lost_password_link')) {
if (!is_null($user) && $user !== '') {
$userObj = $this->userManager->get($user);
if ($userObj instanceof IUser) {
$parameters['canResetPassword'] = $userObj->canChangePassword();
}
}
}
$parameters['alt_login'] = \OC_App::getAlternativeLogIns();
$parameters['rememberLoginAllowed'] = \OC_Util::rememberLoginAllowed();
$parameters['rememberLoginState'] = !empty($remember_login) ? $remember_login : 0;
if (!is_null($user) && $user !== '') {
$parameters['loginName'] = $user;
$parameters['user_autofocus'] = false;
} else {
$parameters['loginName'] = '';
$parameters['user_autofocus'] = true;
}
return new TemplateResponse($this->appName, 'login', $parameters, 'guest');
}
示例5: testGetDefaultPageUrlWithRedirectUrlRedirectBypassWithFrontController
public function testGetDefaultPageUrlWithRedirectUrlRedirectBypassWithFrontController()
{
putenv('front_controller_active=true');
$_REQUEST['redirect_url'] = 'myRedirectUrl.com@foo.com:a';
$this->assertSame('http://localhost' . \OC::$WEBROOT . '/apps/files/', OC_Util::getDefaultPageUrl());
}