Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Controller.php « Openads « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b6f9af9a00605c8930e0808893d9f507de10cb6d (plain)
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
79
80
81
82
<?php
/**
 * Piwik - Open source web analytics
 * 
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
 * @version $Id$
 * 
 * @package Piwik_Openads
 */


/**
 * 
 * @package Piwik_Openads
 */
class Piwik_Openads_Controller extends Piwik_Installation_Controller
{
	function __construct()
	{
		parent::__construct();
	}
	function openadsIntegration()
	{
		
		$view = new Piwik_Install_View(
						'Openads/templates/openadsIntegration.tpl', 
						$this->getInstallationSteps(),
						__FUNCTION__
					);
		$view->showNextStep = true;
	
		$superUserInfos = array(
			'login' 		=> 'openads_root',
			'password' 		=> 'openads_pwd',
			'email' 		=> 'openads_email',
		);
		
		$_SESSION['superuser_infos'] = $superUserInfos;
		
		// we load the DB/config/etc. in order to call the API
		$this->initObjectsToCallAPI();
		
		// we load the websites from opeands and add them to piwik
		$sitesToAdd = array();		
		foreach($sitesToAdd as $site)
		{
			$request = new Piwik_API_Request("
							method=SitesManager.addSite
							&name=$name
							&urls=$url
							&format=original
						");
		}
		
		
		// we load the users from opeands and add them to piwik
		$usersToAdd = array();		
		foreach($usersToAdd as $user)
		{
			$userLogin = $user['login'];
			$userLogin = $user['login'];
			$password = 'fake password because it is not necessary the auth will not be used.';
			
			$email = '';
			$alias = '';
			//addUser( $userLogin, $password, $email, $alias = false )
			$request = new Piwik_API_Request("
							method=UsersManager.addUser
							&userLogin=$userLogin
							&password=$password
							&email=$email
							&alias=$alias
							&format=original
						");
		}
		
		
		$_SESSION['currentStepDone'] = __FUNCTION__;		
		echo $view->render();
	}
}