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 87... | Line 87... | ||
87 | 87 | ||
88 | $ra_email = explode('$',$id)[1]; |
88 | $ra_email = explode('$',$id)[1]; |
89 | $ra = new OIDplusRA($ra_email); |
89 | $ra = new OIDplusRA($ra_email); |
90 | 90 | ||
91 | $out['title'] = $ra->isPasswordLess() ? _L('Create password') : _L('Change RA password'); |
91 | $out['title'] = $ra->isPasswordLess() ? _L('Create password') : _L('Change RA password'); |
92 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : ''; |
92 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,true).'img/main_icon.png' : ''; |
93 | 93 | ||
94 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
94 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
95 | $out['icon'] = 'img/error_big.png'; |
95 | $out['icon'] = 'img/error.png'; |
96 | $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>'; |
96 | $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>'; |
97 | return; |
97 | return; |
98 | } |
98 | } |
99 | 99 | ||
100 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
100 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
101 | if (!$res->any()) { |
101 | if (!$res->any()) { |
102 | $out['icon'] = 'img/error_big.png'; |
102 | $out['icon'] = 'img/error.png'; |
103 | $out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>'); |
103 | $out['text'] = _L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>'); |
104 | return; |
104 | return; |
105 | } |
105 | } |
106 | 106 | ||
107 | $out['text'] .= '<form id="raChangePasswordForm" action="javascript:void(0);" onsubmit="return OIDplusPageRaChangePassword.raChangePasswordFormOnSubmit();">'; |
107 | $out['text'] .= '<form id="raChangePasswordForm" action="javascript:void(0);" onsubmit="return OIDplusPageRaChangePassword.raChangePasswordFormOnSubmit();">'; |
Line 122... | Line 122... | ||
122 | 122 | ||
123 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
123 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
124 | if (!$ra_email) return false; |
124 | if (!$ra_email) return false; |
125 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false; |
125 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) return false; |
126 | 126 | ||
127 | if (file_exists(__DIR__.'/treeicon.png')) { |
127 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
128 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
128 | $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png'; |
129 | } else { |
129 | } else { |
130 | $tree_icon = null; // default icon (folder) |
130 | $tree_icon = null; // default icon (folder) |
131 | } |
131 | } |
132 | 132 | ||
133 | $ra = new OIDplusRA($ra_email); |
133 | $ra = new OIDplusRA($ra_email); |