Rev 279 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 279 | Rev 281 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | if (explode('$',$id)[0] == 'oidplus:ra_log') { |
29 | if (explode('$',$id)[0] == 'oidplus:ra_log') { |
30 | $handled = true; |
30 | $handled = true; |
31 | 31 | ||
32 | $ra_email = explode('$',$id)[1]; |
32 | $ra_email = explode('$',$id)[1]; |
33 | 33 | ||
34 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
34 | if (!OIDplus::authUtils()::isRaLoggedIn($ra_email) && !OIDplus::authUtils()::isAdminLoggedIn()) { |
35 | if ($res->num_rows() == 0) { |
- | |
36 | $out['icon'] = 'img/error_big.png'; |
35 | $out['icon'] = 'img/error_big.png'; |
37 | $out['text'] = 'RA <b>'.htmlentities($ra_email).'</b> does not exist'; |
36 | $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as the requested RA <b>'.htmlentities($ra_email).'</b>.</p>'; |
38 | return $out; |
37 | return; |
39 | } |
38 | } |
40 | 39 | ||
41 | if (!OIDplus::authUtils()::isRaLoggedIn($ra_email) && !OIDplus::authUtils()::isAdminLoggedIn()) { |
40 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
- | 41 | if ($res->num_rows() == 0) { |
|
42 | $out['icon'] = 'img/error_big.png'; |
42 | $out['icon'] = 'img/error_big.png'; |
43 | $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as the requested RA <b>'.htmlentities($ra_email).'</b>.</p>'; |
43 | $out['text'] = 'RA <b>'.htmlentities($ra_email).'</b> does not exist'; |
44 | return $out; |
44 | return; |
45 | } |
45 | } |
46 | 46 | ||
47 | $out['title'] = "Log entries for RA $ra_email"; |
47 | $out['title'] = "Log entries for RA $ra_email"; |
48 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
48 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
49 | 49 | ||
Line 67... | Line 67... | ||
67 | // TODO: Load only X events and then re-load new events via AJAX when the user scrolls down |
67 | // TODO: Load only X events and then re-load new events via AJAX when the user scrolls down |
68 | } |
68 | } |
69 | } |
69 | } |
70 | 70 | ||
71 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
71 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
- | 72 | if (!$ra_email) return false; |
|
- | 73 | if (!OIDplus::authUtils()::isRaLoggedIn($ra_email) && !OIDplus::authUtils()::isAdminLoggedIn()) return false; |
|
- | 74 | ||
72 | if (file_exists(__DIR__.'/treeicon.png')) { |
75 | if (file_exists(__DIR__.'/treeicon.png')) { |
73 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
76 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
74 | } else { |
77 | } else { |
75 | $tree_icon = null; // default icon (folder) |
78 | $tree_icon = null; // default icon (folder) |
76 | } |
79 | } |