Subversion Repositories oidplus

Rev

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

Rev 1206 Rev 1266
Line 41... Line 41...
41
                        if (!$res->any()) {
41
                        if (!$res->any()) {
42
                                throw new OIDplusException(_L('RA does not exist'));
42
                                throw new OIDplusException(_L('RA does not exist'));
43
                        }
43
                        }
44
 
44
 
45
                        if (!OIDplus::authUtils()->isRaLoggedIn($email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
45
                        if (!OIDplus::authUtils()->isRaLoggedIn($email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
46
                                throw new OIDplusException(_L('Authentication error. Please log in as admin, or as the RA to update its data.'));
46
                                throw new OIDplusException(_L('Authentication error. Please log in as admin, or as the RA to update its data.'), null, 401);
47
                        }
47
                        }
48
 
48
 
49
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
49
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
50
                                _CheckParamExists($params, 'old_password');
50
                                _CheckParamExists($params, 'old_password');
51
                                $old_password = $params['old_password'];
51
                                $old_password = $params['old_password'];
Line 111... Line 111...
111
 
111
 
112
                        $out['title'] = $ra->isPasswordLess() ? _L('Create password') : _L('Change RA password');
112
                        $out['title'] = $ra->isPasswordLess() ? _L('Create password') : _L('Change RA password');
113
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
113
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
114
 
114
 
115
                        if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
115
                        if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
116
                                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']);
116
                                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);
117
                        }
117
                        }
118
 
118
 
119
                        $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email));
119
                        $res = OIDplus::db()->query("select * from ###ra where email = ?", array($ra_email));
120
                        if (!$res->any()) {
120
                        if (!$res->any()) {
121
                                throw new OIDplusHtmlException(_L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>'), $out['title']);
121
                                throw new OIDplusHtmlException(_L('RA "%1" does not exist','<b>'.htmlentities($ra_email).'</b>'), $out['title']);