Subversion Repositories bysoftdeveloper

[/] [modules/] [bysoftdeveloper/] [user.php] - Blame information for rev 31

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 alvawu
<?php
2
include_once( 'kernel/common/template.php' );
3
 
4
// total disabled translation for this project.
5
$ini = eZINI::instance();
6
$ini->setVariable('RegionalSettings', 'TextTranslation', 'disabled');
7
 
8
// Authorize the user to admin when doing fetch
9
 
10
 
11
$tpl = templateInit();
12
$http = eZHTTPTool::instance();
13
 
14
 
15
if ($http->postVariable('action') == 'info') {
16
 
17
        $current_user = eZUser::currentUser ();
18
        $admin = eZUser::fetch($ini->variable('BysoftDeveloper', 'AdminID'));
19
        SwitchUser::switchTo($admin);
20
 
21
        $userIDList = array();
22
        $userContentList = eZUser::fetchContentList( );
23
        foreach($userContentList as $userContent)
24
        {
25
                $userIDList[] = $userContent['id'];
26
        }
27
        $userObjectList = eZPersistentObject::fetchObjectList( eZUser::definition(),
28
                                                null,
29
                                                array( 'contentobject_id' => array($userIDList) ),
30
                                                $asObject );
31
 
32
 
33
    $template = 'design:bysoftdeveloper/user/info.tpl';
34
    $tpl->setVariable('current_user', $current_user);
35
        $tpl->setVariable('userObjectList', $userObjectList);
36
    echo $tpl->fetch($template);
37
    SwitchUser::switchTo($current_user);
38
}
39
 
40
if ($http->postVariable('action') == 'switchuser') {
41
        $uid = $http->postVariable('uid');
42
        $user = eZUser::fetch($uid);
43
        if($user instanceof eZUser)
44
        {
45
                SwitchUser::switchTo($user);
46
                echo 'success';
47
        }
48
 
49
    echo $tpl->fetch($template);
50
}
51
 
52
 
53
eZExecution::cleanExit();