function ossn_disable_cache()
{
    $database = new OssnDatabase();
    $params['table'] = 'siteayarlari';
    $params['names'] = array('value');
    $params['values'] = array(0);
    $params['wheres'] = array("setting_id='4'");
    if ($database->update($params)) {
        OssnFile::DeleteDir(ossn_route()->cache);
        return true;
    }
    return false;
}
 /**
  * Delete component
  *
  * @return bool;
  */
 public function deletecom($com)
 {
     if (in_array($com, $this->requiredComponents())) {
         return false;
     }
     $this->statement("DELETE FROM ossn_components WHERE(com_id='{$com}');");
     if ($this->execute()) {
         OssnFile::DeleteDir(ossn_route()->com . "{$com}/");
         return true;
     }
     return false;
 }
 /**
  * Delete theme
  *
  * @return boolean
  */
 public function deletetheme($theme)
 {
     if (OssnFile::DeleteDir(ossn_route()->themes . "{$theme}/")) {
         return true;
     }
     return false;
 }
 /**
  * Delete component
  *
  * @return boolean
  */
 public function delete($com)
 {
     if (in_array($com, $this->requiredComponents())) {
         return false;
     }
     $component = $this->getbyName($com);
     if (!$component) {
         return false;
     }
     $params = array();
     $params['from'] = "ossn_components";
     $params['wheres'] = array("com_id='{$com}'");
     if (parent::delete($params)) {
         //Delete component settings upon its deletion #538
         $entities = new OssnEntities();
         $entities->deleteByOwnerGuid($component->id, 'component');
         //delete component directory
         OssnFile::DeleteDir(ossn_route()->com . "{$com}/");
         return true;
     }
     return false;
 }
 /**
  * Delete Annotation
  *
  * @params $annotation = annotation_id
  *
  * @return bool;
  */
 public function deleteAnnotation($annotation)
 {
     self::initAttributes();
     if ($this->deleteByOwnerGuid($annotation, 'annotation')) {
         $this->statement("DELETE FROM yorumlar WHERE(id='{$annotation}')");
         if ($this->execute()) {
             $data = ossn_get_userdata("annotation/{$annotation}/");
             if (is_dir($data)) {
                 OssnFile::DeleteDir($data);
                 rmdir($data);
             }
             $params['annotation'] = $annotation;
             ossn_trigger_callback('annotation', 'delete', $params);
             return true;
         }
     }
     return false;
 }
Exemple #6
0
 /**
  * Delete component
  *
  * @return boolean
  */
 public function delete($com)
 {
     if (in_array($com, $this->requiredComponents())) {
         return false;
     }
     $params = array();
     $params['from'] = "ossn_components";
     $params['wheres'] = array("com_id='{$com}'");
     if (parent::delete($params)) {
         OssnFile::DeleteDir(ossn_route()->com . "{$com}/");
         return true;
     }
     return false;
 }
 /**
  * Delete user from syste,
  *
  * @return boolean
  */
 public function deleteUser()
 {
     self::initAttributes();
     if (!empty($this->guid) && !empty($this->username)) {
         $params['from'] = 'ossn_users';
         $params['wheres'] = array("guid='{$this->guid}'");
         if ($this->delete($params)) {
             //delete user files
             $datadir = ossn_get_userdata("user/{$this->guid}/");
             if (is_dir($datadir)) {
                 OssnFile::DeleteDir($datadir);
                 //From of v2.0 DeleteDir delete directory also #138
                 //rmdir($datadir);
             }
             //delete user entites also
             $this->deleteByOwnerGuid($this->guid, 'user');
             //delete annotations
             $this->OssnAnnotation->owner_guid = $this->guid;
             $this->OssnAnnotation->deleteAnnotationByOwner($this->guid);
             //trigger callback so other components can be notified when user deleted.
             //should delete relationships
             ossn_delete_user_relations($this);
             $vars['entity'] = $this;
             ossn_trigger_callback('user', 'delete', $vars);
             return true;
         }
     }
     return false;
 }
 /**
  * Delete object;
  *
  * @param integer $object Object guid
  *
  * @return boolean
  */
 public function deleteObject($object)
 {
     self::initAttributes();
     if (isset($this->guid)) {
         $object = $this->guid;
     }
     //delete entites of (this) object
     if ($this->deleteByOwnerGuid($object, 'object')) {
         $data = ossn_get_userdata("object/{$object}/");
         if (is_dir($data)) {
             OssnFile::DeleteDir($data);
         }
     }
     $delete['from'] = 'ossn_object';
     $delete['wheres'] = array("guid='{$object}'");
     if ($this->delete($delete)) {
         return true;
     }
     return false;
 }
 /**
  * Delete object;
  *
  * @params = $object => object guid
  *
  * @return bool;
  */
 public function deleteObject($object)
 {
     //delete entites of (this) object
     if ($this->deleteByOwnerGuid($object, 'object')) {
         $data = ossn_get_userdata("object/{$object}/");
         if (is_dir($data)) {
             OssnFile::DeleteDir($data);
             rmdir($data);
         }
     }
     $this->statement("DELETE FROM paylasimlar WHERE(guid='{$object}')");
     if ($this->execute()) {
         return true;
     }
     return false;
 }