Subversion Repositories oidplus

Rev

Rev 790 | Rev 801 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 790 Rev 800
Line 29... Line 29...
29
                        $handled = true;
29
                        $handled = true;
30
 
30
 
31
                        $ra_email = explode('$',$id)[1];
31
                        $ra_email = explode('$',$id)[1];
32
 
32
 
33
                        $out['title'] = _L('Log messages for RA %1',$ra_email);
33
                        $out['title'] = _L('Log messages for RA %1',$ra_email);
34
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
34
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : '';
35
 
35
 
36
                        if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
36
                        if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
37
                                $out['icon'] = 'img/error_big.png';
37
                                $out['icon'] = 'img/error.png';
38
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as the requested RA %2.',OIDplus::gui()->link('oidplus:login$ra$'.$ra_email),'<b>'.htmlentities($ra_email).'</b>').'</p>';
38
                                $out['text'] = '<p>'._L('You need to <a %1>log in</a> as the requested RA %2.',OIDplus::gui()->link('oidplus:login$ra$'.$ra_email),'<b>'.htmlentities($ra_email).'</b>').'</p>';
39
                                return;
39
                                return;
40
                        }
40
                        }
41
 
41
 
42
                        $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email));
42
                        $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email));
43
                        if (!$res->any()) {
43
                        if (!$res->any()) {
44
                                $out['icon'] = 'img/error_big.png';
44
                                $out['icon'] = 'img/error.png';
45
                                $out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>');
45
                                $out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>');
46
                                return;
46
                                return;
47
                        }
47
                        }
48
 
48
 
49
                        $res = OIDplus::db()->query("select lo.unix_ts, lo.addr, lo.event, lu.severity from ###log lo ".
49
                        $res = OIDplus::db()->query("select lo.unix_ts, lo.addr, lo.event, lu.severity from ###log lo ".
Line 69... Line 69...
69
 
69
 
70
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
70
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
71
                if (!$ra_email) return false;
71
                if (!$ra_email) return false;
72
                if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false;
72
                if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false;
73
 
73
 
74
                if (file_exists(__DIR__.'/treeicon.png')) {
74
                if (file_exists(__DIR__.'/img/main_icon16.png')) {
75
                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
75
                        $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png';
76
                } else {
76
                } else {
77
                        $tree_icon = null; // default icon (folder)
77
                        $tree_icon = null; // default icon (folder)
78
                }
78
                }
79
 
79
 
80
                $json[] = array(
80
                $json[] = array(