Rev 1219 | Rev 1267 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1219 | Rev 1266 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | _CheckParamExists($params, 'email'); |
36 | _CheckParamExists($params, 'email'); |
37 | 37 | ||
38 | $email = $params['email']; |
38 | $email = $params['email']; |
39 | 39 | ||
40 | if (!OIDplus::authUtils()->isRaLoggedIn($email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
40 | if (!OIDplus::authUtils()->isRaLoggedIn($email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
41 | throw new OIDplusException(_L('Authentication error. Please log in as admin, or as the RA to update its data.')); |
41 | throw new OIDplusException(_L('Authentication error. Please log in as admin, or as the RA to update its data.'), null, 401); |
42 | } |
42 | } |
43 | 43 | ||
44 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($email)); |
44 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($email)); |
45 | if (!$res->any()) { |
45 | if (!$res->any()) { |
46 | throw new OIDplusException(_L('RA does not exist')); |
46 | throw new OIDplusException(_L('RA does not exist')); |
Line 102... | Line 102... | ||
102 | 102 | ||
103 | $out['title'] = _L('Edit RA contact data'); |
103 | $out['title'] = _L('Edit RA contact data'); |
104 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
104 | $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : ''; |
105 | 105 | ||
106 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
106 | if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) { |
107 | throw new OIDplusHtmlException(_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>'), $out['title']); |
107 | throw new OIDplusHtmlException(_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>'), $out['title'], 401); |
108 | } |
108 | } |
109 | 109 | ||
110 | $out['text'] = '<p>'._L('Your email address: %1','<b>'.htmlentities($ra_email).'</b>').'</p>'; |
110 | $out['text'] = '<p>'._L('Your email address: %1','<b>'.htmlentities($ra_email).'</b>').'</p>'; |
111 | 111 | ||
112 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |
112 | $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email)); |