Example #1
0
 public static function Update()
 {
     // Grab all of the API keys that SeAT
     // is aware of
     $seat_keys = \SeatKey::all();
     // Looping over all of the keys, we will find
     // the superusers and send them the
     // notification about this
     foreach ($seat_keys as $seat_key) {
         if ($seat_key->isOk == 0) {
             // We have a key that is not OK, find
             // some people to tell about this!
             foreach (\Auth::findAllUsersWithAccess('superuser') as $super_user) {
                 // Compile the full notification
                 $notification_type = 'API';
                 $notification_title = 'Disabled Key';
                 $notification_text = 'The SeAT backend has disabled API key ' . $seat_key->keyID . '. ' . 'The last error was: ' . $seat_key->lastError;
                 // Send the Notification
                 BaseNotify::sendNotification($super_user->id, $notification_type, $notification_title, $notification_text);
             }
         }
     }
 }
Example #2
0
 public function index()
 {
     return Response::json(array('error' => false, 'keys' => SeatKey::all()->toArray()), 200);
 }