예제 #1
0
 public function runRole($data)
 {
     $roleID = $data['roleID'];
     $roleName = $data['roleName'];
     $rolePerm = Hooks::maybe_serialize($data['permission']);
     $strSQL = DB::inst()->query(sprintf("REPLACE INTO `role` SET `ID` = %u, `roleName` = '%s', `permission` = '%s'", $roleID, $roleName, $rolePerm));
     redirect(BASE_URL . 'role/');
 }
예제 #2
0
 /**
  * Writes cache data to be read
  * 
  * @access public
  * @since 4.3
  * @param string (required) $data Data that should be cached
  * @param string (required) $filename Name of the cache file
  * @return mixed
  */
 public function writeCache($fileName, $data)
 {
     $this->_cachefile = $this->_cachepath . $fileName . $this->_extension;
     $fp = fopen($this->_cachefile, 'w');
     if ($fp) {
         $values = Hooks::maybe_serialize($data);
         fwrite($fp, $values);
         fclose($fp);
     } else {
         return $this->addLog('Could not read filename: ' . $fileName . ' data: ' . $data);
     }
 }