Пример #1
0
 public function add_to_track($track)
 {
     if (!$this->id) {
         $this->save();
     }
     return DigiplayDB::insert("audioartists", array("audioid" => $track->get_id(), "artistid" => $this->id));
 }
Пример #2
0
 public function save()
 {
     if ($this->id) {
         DigiplayDB::update("showitems", get_object_vars($this), "id = " . $this->id);
     } else {
         $this->id = DigiplayDB::insert("showitems", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #3
0
 public function save()
 {
     if (isset($this->id)) {
         DigiplayDB::update("sustslots", get_object_vars($this), "id = " . $this->id);
     } else {
         $this->id = DigiplayDB::insert("sustslots", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #4
0
 public function save()
 {
     if (!$this->name) {
         return false;
     }
     if ($this->id) {
         DigiplayDB::update("albums", get_object_vars($this), "id = " . $this->id);
     } else {
         $this->id = DigiplayDB::insert("albums", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #5
0
 public function save()
 {
     if (!$this->content) {
         return false;
     }
     if ($this->id) {
         DigiplayDB::update("info_faults", get_object_vars($this), "id = " . $this->id);
     } else {
         $this->id = DigiplayDB::insert("info_faults", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #6
0
 public function save()
 {
     if (!$this->name) {
         return false;
     }
     if ($this->id) {
         DigiplayDB::update("requests", get_object_vars($this), "id = " . $this->id . ";");
     } else {
         $this->date = time();
         $this->id = DigiplayDB::insert("requests", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #7
0
 public function save()
 {
     if (!$this->name) {
         return false;
     }
     if ($this->id) {
         DigiplayDB::update("showplans", get_object_vars($this), "id = " . $this->id);
     } else {
         if (!$this->creationdate) {
             $this->creationdate = date();
         }
         $this->id = DigiplayDB::insert("showplans", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #8
0
 public function save()
 {
     if (!$this->track_title) {
         return false;
     }
     if ($this->id) {
         DigiplayDB::update("log", get_object_vars($this), "id = " . $this->id . ";");
     } else {
         $this->datetime = time();
         if ($this->userid == NULL) {
             $this->userid = 0;
         }
         $this->id = DigiplayDB::insert("log", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #9
0
 public function save()
 {
     if (isset($this->id)) {
         DigiplayDB::update('jinglepkgs', get_object_vars($this), 'id = ' . $this->id);
     } else {
         if (!isset($this->name)) {
             return false;
         }
         if (!isset($this->enabled)) {
             $this->enabled = 'f';
         }
         if (!isset($this->archived)) {
             $this->archived = 'f';
         }
         $this->id = DigiplayDB::insert('jinglepkgs', get_object_vars($this), 'id');
     }
     return $this->id;
 }
Пример #10
0
                 }
             } elseif ($_REQUEST['val'] == 'admin') {
                 $new = '111';
             }
             $data = array('permissions' => $new);
             DigiplayDB::update("aw_sets_permissions", $data, "set_id = '" . $a->get_id() . "' AND user_id = '" . $user->get_id() . "'");
         } else {
             if ($_REQUEST['val'] == 'viewer') {
                 $data = array('user_id' => $user->get_id(), 'set_id' => $a->get_id(), 'permissions' => '100');
                 DigiplayDB::insert("aw_sets_permissions", $data);
             } elseif ($_REQUEST['val'] == 'editor') {
                 $data = array('user_id' => $user->get_id(), 'set_id' => $a->get_id(), 'permissions' => '110');
                 DigiplayDB::insert("aw_sets_permissions", $data);
             } elseif ($_REQUEST['val'] == 'admin') {
                 $data = array('user_id' => $user->get_id(), 'set_id' => $a->get_id(), 'permissions' => '111');
                 DigiplayDB::insert("aw_sets_permissions", $data);
             }
         }
     } else {
         exit(json_encode(array("error" => "User Not Found!")));
     }
     if (Errors::occured()) {
         http_response_code(400);
         exit(json_encode(array("error" => "Something went wrong. You may have discovered a bug!", "detail" => Errors::report("array"))));
         Errors::clear();
     } else {
         exit(json_encode(array('response' => 'success', 'id' => $a->get_id())));
     }
 } else {
     http_response_code(403);
     exit(json_encode(array('error' => 'Permission denied.')));
Пример #11
0
        foreach ($walls as $wall) {
            $w++;
        }
        if ($_REQUEST['name'] == "") {
            $name = "New Page";
        } else {
            $name = $_REQUEST['name'];
        }
        if ($_REQUEST['desc'] == "") {
            $desc = "New Page";
        } else {
            $desc = $_REQUEST['desc'];
        }
        $table = "aw_walls";
        $data = array('id' => NULL, 'name' => pg_escape_string($name), 'set_id' => $_REQUEST['setid'], 'page' => $w, 'description' => pg_escape_string($desc));
        DigiplayDB::insert($table, $data);
        if (Errors::occured()) {
            http_response_code(400);
            exit(json_encode(array("error" => "Something went wrong. You may have discovered a bug!", "detail" => Errors::report("array"))));
            Errors::clear();
        } else {
            exit(json_encode(array('response' => 'success', 'id' => $a->get_id())));
        }
    } else {
        http_response_code(403);
        exit(json_encode(array('error' => 'Permission denied.')));
    }
} else {
    http_response_code(403);
    exit(json_encode(array('error' => 'Permission denied.')));
}
Пример #12
0
 public function save()
 {
     if (isset($this->id)) {
         DigiplayDB::update("audio", get_object_vars($this), "id = " . $this->id);
     } else {
         if (!isset($this->md5) || !isset($this->archive) || !isset($this->filetype)) {
             return false;
         }
         if (!isset($this->sustainer)) {
             $this->sustainer = 'f';
         }
         if (!isset($this->censor)) {
             $this->censor = 'f';
         }
         if (!isset($this->creation_date)) {
             $this->creation_date = time();
         }
         if (!isset($this->creator)) {
             $this->creator = 1;
         }
         if (!isset($this->intro_smpl)) {
             $this->intro_smpl = 0;
         }
         if (!isset($this->extro_smpl)) {
             $this->extro_smpl = $this->length_smpl;
         }
         if (!isset($this->end_smpl)) {
             $this->end_smpl = $this->length_smpl;
         }
         if (!isset($this->start_smpl)) {
             $this->start_smpl = 0;
         }
         if (!isset($this->import_date)) {
             $this->import_date = time();
         }
         if (!isset($this->type)) {
             $this->set_type(AudioTypes::get_by_name("Track"));
         }
         $this->id = DigiplayDB::insert("audio", get_object_vars($this), "id");
     }
     return $this->id;
 }
Пример #13
0
 public static function login($username, $password)
 {
     if (Configs::get_system_param("auth_method") != "LDAP") {
         $local_user = DigiplayDB::select("* FROM users WHERE username = '******' AND password = '******';", "User");
         if ($local_user) {
             self::$data["user"] = true;
             self::$user_object = $local_user;
         } else {
             return false;
         }
     } else {
         $ldap_instance = new LDAP();
         if (!$ldap_instance->login($username, $password)) {
             return false;
         }
         if (is_object($ldap_instance) && get_class($ldap_instance) == "LDAP") {
             if ($ldap_instance->login_status()) {
                 self::$data = $ldap_instance->userdetails();
                 self::$data["user"] = true;
                 # Get the user's info, or insert them as a new user if there isn't any
                 self::$user_object = Users::get_by_username(self::$data["username"]);
                 if (!self::$user_object) {
                     $id = DigiplayDB::insert("users", array("username" => self::$data["username"], "password" => NULL), "id");
                     self::$user_object = Users::get_by_id($id);
                 }
             } else {
                 return false;
             }
         }
     }
     if (self::$user_object) {
         $result = self::$user_object->get_config_var("user_curlogin");
         if ($result) {
             self::$data["lastlogin"] = $result;
             DigiplayDB::query("UPDATE usersconfigs SET val = '" . time() . "' WHERE userid = " . self::$user_object->get_id() . " AND configid = 3;");
         } else {
             DigiplayDB::query("INSERT INTO usersconfigs (userid,configid,val) VALUES (" . self::$user_object->get_id() . ",3,'" . time() . "');");
             DigiplayDB::query("INSERT INTO usersconfigs (userid,configid,val) VALUES (" . self::$user_object->get_id() . ",1,'');");
         }
         return true;
     } else {
         return false;
     }
 }
Пример #14
0
 public function add_track($track)
 {
     return DigiplayDB::insert("audioplaylists", array("audioid" => $track->get_id(), "playlistid" => $this->id));
 }
Пример #15
0
 public function move_to_music_folder()
 {
     DigiplayDB::delete("audiodir", "audioid = " . $this->id);
     return DigiplayDB::insert("audiodir", array("dirid" => 2, "audioid" => $this->id));
 }