Example #1
0
 /**
  * checks if a 'user_id' owns 'id' of a 'table' meaning that he should
  * be able e.g. edit and delete this row. 
  * @param string $table able name
  * @param string $id primary id of table 
  * @param type $user_id the users account id
  * @return array|false $row if row was found else false
  */
 public static function ownID($table, $id, $user_id)
 {
     $row = q::setSelect($table)->filter('id =', $id)->condition('AND')->filter('user_id = ', $user_id)->fetchSingle();
     if (empty($row)) {
         return false;
     }
     return $row;
 }
Example #2
0
 /**
  * sets db routes
  */
 public static function setDbRoutes()
 {
     $routes = q::setSelect('system_route')->fetch();
     if (empty($routes)) {
         conf::$vars['coscms_main']['routes'] = array();
     }
     foreach ($routes as $route) {
         conf::$vars['coscms_main']['routes'][$route['route']] = unserialize($route['value']);
     }
 }