/**
  * config_site_update function.
  * 
  * @access public
  * @return void
  */
 function config_site_update()
 {
     // Set the selected menu
     foreach ($_POST as $key => $val) {
         $data[$key] = $this->EE->input->post($key, TRUE);
     }
     // Unset some unwanted post variables
     unset($data["submit"]);
     unset($data["max_file_size"]);
     // Update the countries
     if (!isset($data["countries"])) {
         $data["countries"] = array();
     }
     $this->EE->store_model->update_countries($data);
     unset($data["countries"]);
     if (isset($_FILES)) {
         $config['upload_path'] = $this->vars["media_dir"];
         $config['allowed_types'] = 'gif|jpg|png';
         $config['max_size'] = '1000';
         $config['max_width'] = '1024';
         $config['max_height'] = '768';
         $this->EE->load->library('upload', $config);
         if ($this->EE->upload->do_upload('logo')) {
             $result = array('upload_data' => $this->EE->upload->data());
             $data["logo"] = $result["upload_data"]["file_name"];
         }
     }
     if (!uuid_validate($data["license"])) {
         $data["license"] = '';
         $this->EE->session->set_flashdata('message_failure', lang('br_invalid_license'));
     }
     $this->EE->store_model->update_store($data);
     // Clear the cache file before we redirect
     remove_from_cache('config');
     $this->EE->core_model->get_config();
     $_SESSION["message"] = lang('br_store_update_success');
     $this->EE->functions->redirect($this->base_url . AMP . 'method=config_site');
 }
Exemple #2
0
function uuid_v5($namespace, $name)
{
    if (!uuid_validate($namespace)) {
        return false;
    }
    // Get hexadecimal components of namespace
    $nhex = str_replace(array('-', '{', '}'), '', $namespace);
    // Binary Value
    $nstr = '';
    // Convert Namespace UUID to bits
    for ($i = 0; $i < strlen($nhex); $i += 2) {
        $nstr .= chr(hexdec($nhex[$i] . $nhex[$i + 1]));
    }
    // Calculate hash value
    $hash = sha1($nstr . $name);
    return sprintf('%08s-%04s-%04x-%04x-%12s', substr($hash, 0, 8), substr($hash, 8, 4), hexdec(substr($hash, 12, 4)) & 0xfff | 0x5000, hexdec(substr($hash, 16, 4)) & 0x3fff | 0x8000, substr($hash, 20, 12));
}