示例#1
0
 public static function ajax_passwdLoadJobs_callback()
 {
     if (!wfAPI::SSLEnabled()) {
         return array('ok' => 1);
     }
     //If user hits start passwd audit they will get a helpful message. We don't want an error popping up for every ajax call if SSL is not supported.
     $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
     try {
         $res = $api->call('password_load_jobs', array(), array(), true);
     } catch (Exception $e) {
         return array('errorMsg' => "Could not load password audit jobs: " . $e);
     }
     if (is_array($res) && $res['ok']) {
         return array('ok' => 1, 'results' => $res['results']);
     } else {
         return array('ok' => 1);
         //fail silently
     }
 }