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 78... | Line 78... | ||
78 | $handled = true; |
78 | $handled = true; |
79 | 79 | ||
80 | $ra_email = explode('$',$id)[1]; |
80 | $ra_email = explode('$',$id)[1]; |
81 | 81 | ||
82 | $out['title'] = _L('Edit RA contact data'); |
82 | $out['title'] = _L('Edit RA contact data'); |
83 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
83 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : ''; |
84 | 84 | ||
85 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
85 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
86 | $out['icon'] = 'img/error_big.png'; |
86 | $out['icon'] = 'img/error.png'; |
87 | $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>'; |
87 | $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>'; |
88 | return; |
88 | return; |
89 | } |
89 | } |
90 | 90 | ||
91 | $out['text'] = '<p>'._L('Your email address: %1','<b>'.htmlentities($ra_email).'</b>').'</p>'; |
91 | $out['text'] = '<p>'._L('Your email address: %1','<b>'.htmlentities($ra_email).'</b>').'</p>'; |
92 | 92 | ||
93 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
93 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
94 | if (!$res->any()) { |
94 | if (!$res->any()) { |
95 | $out['icon'] = 'img/error_big.png'; |
95 | $out['icon'] = 'img/error.png'; |
96 | $out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>'); |
96 | $out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>'); |
97 | return; |
97 | return; |
98 | } |
98 | } |
99 | $row = $res->fetch_array(); |
99 | $row = $res->fetch_array(); |
100 | 100 | ||
Line 131... | Line 131... | ||
131 | 131 | ||
132 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
132 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
133 | if (!$ra_email) return false; |
133 | if (!$ra_email) return false; |
134 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false; |
134 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false; |
135 | 135 | ||
136 | if (file_exists(__DIR__.'/treeicon.png')) { |
136 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
137 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
137 | $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png'; |
138 | } else { |
138 | } else { |
139 | $tree_icon = null; // default icon (folder) |
139 | $tree_icon = null; // default icon (folder) |
140 | } |
140 | } |
141 | 141 | ||
142 | $json[] = array( |
142 | $json[] = array( |