-
Notifications
You must be signed in to change notification settings - Fork 1
/
token.php
executable file
·78 lines (64 loc) · 1.52 KB
/
token.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Contao Open Source CMS
*
* Copyright (C) 2005-2012 Leo Feyer
*
* @package cloud-api
* @author David Molineus <http://www.netzmacht.de>
* @license GNU/LGPL
* @copyright Copyright 2012 David Molineus netzmacht creative
*
**/
namespace Netzmacht\Cloud\Api;
use Backend;
/**
* Initialize the system
*/
define('TL_MODE', 'BE');
//require_once '../..//initialize.php';
require_once '/var/www/dev/system/initialize.php';
/**
* AccesToken will redirect to cloud authorize page
*
* @copyright Leo Feyer 2005-2012
* @author Leo Feyer <http://contao.org>
* @package Core
*/
class AccessToken extends Backend
{
/**
* Initialize the controller
*
* 1. Import the user
* 2. Call the parent constructor
* 3. Authenticate the user
* 4. Load the language files
* DO NOT CHANGE THIS ORDER!
*/
public function __construct()
{
$this->import('BackendUser', 'User');
parent::__construct();
$this->User->authenticate();
$this->loadLanguageFile('default');
$this->loadLanguageFile('modules');
}
/**
* load cloud api and redirect to authorize page
*
* @return void
*/
public function run()
{
$this->import('Input');
$objApi = CloudApiManager::getApi($this->Input->get('api'));
$strUrl = $objApi->getAuthorizeUrl();
$this->redirect($strUrl);
}
}
/**
* Instantiate the controller
*/
$objAccessToken = new AccessToken();
$objAccessToken->run();