Ejemplo n.º 1
0
function white_list_insert($post, $db)
{
    $new_white_list = new Rule();
    $new_white_list->setWhiteListType($post['wl_filter'] + 1);
    $new_white_list->setWhiteListData($post['wl_data']);
    $new_white_list->setWhiteListActive($post['validity']);
    $new_white_list->setFilled(true);
    $db->addWhiteLists($new_white_list);
}
Ejemplo n.º 2
0
 public function getAllWhiteLists($where = '', $wlimit = '')
 {
     $count_str = "SELECT WL.RecordID,WL.WhiteListType,\n                  WL.WhiteListData,WL.Deleted\n                  FROM white_list WL\n                  WHERE 1 {$where} ORDER BY WL.RecordID DESC {$wlimit}";
     $result = $this->dbh->query($count_str);
     if (PEAR::isError($result)) {
         echo $result->getMessage() . ' - ' . $result->getUserinfo();
         exit;
     }
     $array = $result->fetchAll();
     $result->free();
     $white_lists = array();
     foreach ($array as $wl) {
         $white_list = new Rule();
         $white_list->setWhiteListRecordID($wl[0]);
         $white_list->setWhiteListType($wl[1]);
         $white_list->setWhiteListData($wl[2]);
         $white_list->setWhiteListActive($wl[3]);
         $white_lists[] = $white_list;
     }
     return $white_lists;
 }