Exemplo n.º 1
0
 public static function list_owner_or_admin(\Snabb\Database\Connection $db, $user_id, $list_id)
 {
     if ($db->query('SELECT list_id FROM lists WHERE user_id = ' . (int) $user_id . ' AND list_id = ' . (int) $list_id)->fetch() !== false) {
         return true;
     }
     if ($db->query('SELECT list_id FROM list_users WHERE user_id =' . (int) $user_id . ' AND list_id = ' . (int) $list_id . ' AND list_admin_from IS NOT NULL')->fetch() !== false) {
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 public static function getData(\Snabb\Database\Connection $db, $key)
 {
     $data = $db->query('SELECT event_value FROM events WHERE event_key = ' . $db->quote($key))->fetch();
     return ($data !== false and $data['event_value'] !== null) ? $data['event_value'] : false;
 }