Rev 148 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 148 | Rev 150 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | if (isset($_POST["action"]) && ($_POST["action"] == "change_ra_password")) { |
32 | if (isset($_POST["action"]) && ($_POST["action"] == "change_ra_password")) { |
33 | $handled = true; |
33 | $handled = true; |
34 | 34 | ||
35 | $email = $_POST['email']; |
35 | $email = $_POST['email']; |
36 | 36 | ||
37 | $res = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."ra where email = '".OIDplus::db()->real_escape_string($email)."'"); |
37 | $res = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."ra where email = ?", array($email)); |
38 | if (OIDplus::db()->num_rows($res) == 0) { |
38 | if (OIDplus::db()->num_rows($res) == 0) { |
39 | die(json_encode(array("error" => 'RA does not exist'))); |
39 | die(json_encode(array("error" => 'RA does not exist'))); |
40 | } |
40 | } |
41 | 41 | ||
42 | if (!OIDplus::authUtils()::isRaLoggedIn($email) && !OIDplus::authUtils()::isAdminLoggedIn()) { |
42 | if (!OIDplus::authUtils()::isRaLoggedIn($email) && !OIDplus::authUtils()::isAdminLoggedIn()) { |
Line 80... | Line 80... | ||
80 | $out['title'] = 'Change RA password'; |
80 | $out['title'] = 'Change RA password'; |
81 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? 'plugins/'.basename(dirname(__DIR__)).'/'.basename(__DIR__).'/icon_big.png' : ''; |
81 | $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? 'plugins/'.basename(dirname(__DIR__)).'/'.basename(__DIR__).'/icon_big.png' : ''; |
82 | 82 | ||
83 | $ra_email = explode('$',$id)[1]; |
83 | $ra_email = explode('$',$id)[1]; |
84 | 84 | ||
85 | $res = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."ra where email = '".OIDplus::db()->real_escape_string($ra_email)."'"); |
85 | $res = OIDplus::db()->query("select * from ".OIDPLUS_TABLENAME_PREFIX."ra where email = ?", array($ra_email)); |
86 | if (OIDplus::db()->num_rows($res) == 0) { |
86 | if (OIDplus::db()->num_rows($res) == 0) { |
87 | $out['icon'] = 'img/error_big.png'; |
87 | $out['icon'] = 'img/error_big.png'; |
88 | $out['text'] = 'RA <b>'.htmlentities($ra_email).'</b> does not exist'; |
88 | $out['text'] = 'RA <b>'.htmlentities($ra_email).'</b> does not exist'; |
89 | return $out; |
89 | return $out; |
90 | } |
90 | } |