public function set_table_search($tbl) { //assuring $data is safe to be executed on a db query EDatabase::safe($data); //setting internal attribute if (EDatabase::table_exists($tbl)) { $this->table = $tbl; $this->datatable = new EData($this->table); } else { ELog::error("{$tbl} does not exists on database."); } }
public static function db_post($key) { if (isset(EHeaderDataParser::$posts[$key])) { if (EHeaderDataParser::$quotes) { return EHeaderDataParser::$posts[$key]; } else { return EDatabase::safe(EHeaderDataParser::$posts[$key]); } } else { return false; } }
public function set_data($data) { // assuring those are not evil data to be used as SQL injections EDatabase::safe($data); //data validations if (!isset($data['type'])) { ELog::error("OCSContent: type not defined. Mandatory field."); } else { $this->type = $data['type']; } if (!isset($data['name'])) { ELog::error("OCSContent: name not defined. Mandatory field."); } else { $this->name = $data['name']; } if (!isset($data['personid'])) { ELog::error("OCSContent: personid not defined. Mandatory field."); } else { $this->personid = $data['personid']; } if (!isset($data['downloadname1'])) { $this->downloadname1 = ""; } else { $this->downloadname1 = $data['downloadname1']; } if (!isset($data['downloadlink1'])) { $this->downloadlink1 = ""; } else { $this->downloadlink1 = $data['downloadlink1']; } if (!isset($data['description'])) { $this->description = ""; } else { $this->description = $data['description']; } if (!isset($data['summary'])) { $this->summary = ""; } else { $this->summary = $data['summary']; } if (!isset($data['version'])) { $this->version = ""; } else { $this->version = $data['version']; } if (!isset($data['changelog'])) { $this->changelog = ""; } else { $this->changelog = $data['changelog']; } if (!isset($data['preview1'])) { $this->preview1 = ""; } else { $this->preview1 = $data['preview1']; } if (!isset($data['preview2'])) { $this->preview2 = ""; } else { $this->preview2 = $data['preview2']; } if (!isset($data['preview3'])) { $this->preview3 = ""; } else { $this->preview3 = $data['preview3']; } if (!isset($data['license'])) { $this->license = ""; } else { $this->license = $data['license']; } }
public function set_data($data) { // assuring those are not evil data to be used as SQL injections EDatabase::safe($data); //data validations if (!isset($data['type'])) { $this->type = 1; } else { $this->type = $data['type']; } if (!isset($data['owner'])) { $this->owner = 0; /* anonymous */ } else { $this->owner = $data['owner']; } if (!isset($data['content'])) { $this->content = ""; } else { $this->content = $data['content']; } if (!isset($data['content2'])) { $this->content2 = ""; } else { $this->content2 = $data['content2']; } if (!isset($data['parent'])) { $this->parent = ""; } else { $this->parent = $data['parent']; } if (!isset($data['votes'])) { $this->votes = ""; } else { $this->votes = $data['votes']; } if (!isset($data['score'])) { $this->score = ""; } else { $this->score = $data['score']; } if (!isset($data['subject'])) { $this->subject = ""; } else { $this->subject = $data['subject']; } if (!isset($data['message'])) { $this->message = ""; } else { $this->message = $data['message']; } if (!isset($data['data'])) { $this->data = date(" j/n/Y H:i:s "); } }
public static function server_countusersbyemail($email) { //autoload if necessary if (is_null(OCSUser::$persons)) { OCSUser::server_load(); } $email = EDatabase::safe($email); $r = OCSUser::$persons->count("login", "email='{$email}'"); return $r; }