/**
  * Returns a list of whitelisted domains
  */
 public static function toArray()
 {
     $whitelist = array();
     foreach (EmailWhitelist::model()->findAll() as $row) {
         $whitelist[] = strtolower($row['domain']);
     }
     return $whitelist;
 }
 /**
  * Deletes a whitelist record
  */
 public function actionDelete()
 {
     $id = (int) Yii::app()->request->getQuery('id');
     $doit = (int) Yii::app()->request->getQuery('doit');
     $emailWhitelist = EmailWhitelist::model()->resetScope()->findByPk($id);
     if ($emailWhitelist == null) {
         throw new CHttpException(404, "Karma record not found");
     }
     if ($doit == 2) {
         $this->forcePostRequest();
         $emailWhitelist->delete();
         $this->redirect($this->createUrl('index'));
     }
     $this->render('delete', array('model' => $emailWhitelist));
 }