コード例 #1
0
ファイル: Config.php プロジェクト: rexcarnation/XtraUpload-1
 /**
  * Config::index()
  *
  * Load the site config into xHTML for editing/viewing
  *
  * @access	public
  * @author	Matthew Glinski
  * @return	void
  */
 public function index()
 {
     // Get the DB config object
     $data['configs'] = $this->db->get_where('config', array('name !=' => '_db_version', 'group' => 0));
     $data['langs'] = available_lang();
     // Load a message
     $data['flash_message'] = '';
     if ($this->session->flashdata('msg')) {
         $data['flash_message'] = '<span class="info"><strong>' . $this->session->flashdata('msg') . '</strong></span>';
     }
     // Send the files to the user
     $this->load->view($this->startup->skin . '/header', array('header_title' => lang('Manage Site Config')));
     $this->load->view($this->startup->skin . '/admin/config/main', $data);
     $this->load->view($this->startup->skin . '/footer');
 }
コード例 #2
0
ファイル: User.php プロジェクト: rexcarnation/XtraUpload-1
 /**
  * User::manage()
  *
  * User management
  *
  * @access	public
  * @return	void
  */
 public function manage()
 {
     if (!$this->session->userdata('id')) {
         redirect('/user/login');
     }
     $data['error_message'] = '';
     if ($this->session->flashdata('error_message')) {
         $data['error_message'] = $this->session->flashdata('error_message');
     }
     $config = array(array('field' => 'email', 'label' => lang('Email'), 'rules' => 'trim|valid_email'), array('field' => 'username', 'label' => lang('Username'), 'rules' => 'trim|callback_check_user'), array('field' => 'password', 'label' => lang('Password'), 'rules' => 'trim|min_length[5]|max_length[70]'));
     $this->form_validation->set_rules($config);
     if ($this->form_validation->run() == FALSE and $this->input->post('username')) {
         $this->form_validation->set_error_delimiters('<li>', '</li>');
         $error = validation_errors();
         $data['error_message'] = '<p><span class="alert"><strong>' . lang('Error:') . '</strong><br>' . $error . '</span></p>';
         $query = $this->db->get_where('users', array('id' => $this->session->userdata('id')));
         $data['user'] = $query->row();
         $data['locales'] = available_lang();
         $this->load->view($this->startup->skin . '/header', array('header_title' => lang('Manage Account')));
         $this->load->view($this->startup->skin . '/user/manage', $data);
         $this->load->view($this->startup->skin . '/footer');
     } else {
         if (!$this->input->post('username')) {
             $query = $this->db->get_where('users', array('id' => $this->session->userdata('id')));
             $data['user'] = $query->row();
             $data['locales'] = available_lang();
             $this->load->view($this->startup->skin . '/header', array('header_title' => lang('Manage Account')));
             $this->load->view($this->startup->skin . '/user/manage', $data);
             $this->load->view($this->startup->skin . '/footer');
         } else {
             $this->_user_update();
         }
     }
 }
コード例 #3
0
ファイル: Startup.php プロジェクト: rexcarnation/XtraUpload-1
 /**
  * Constructor
  *
  * Set any variables
  *
  * @accses	public
  * @return	void
  */
 public function __construct()
 {
     log_message('debug', "Startup Class Initialized");
     // Define the path to the cache folder
     define('CACHEPATH', APPPATH . 'cache/');
     // Define Hard Coded Script Version
     include APPPATH . '/config/xu_ver.php';
     define('XU_VERSION', $version);
     $this->CI =& get_instance();
     // Load the DB and session class
     $this->CI->load->database();
     // Load General Functions and XU API
     $this->CI->load->library(array('functions', 'xu_api'));
     $this->_check_setup();
     define('XU_VERSION_READ', $this->CI->functions->parse_version(XU_VERSION));
     define('XU_DB_VERSION_READ', $this->CI->functions->parse_version($this->db_version));
     $this->available_locale = available_lang();
     if (!isset($this->CI->config->config['is_installed'])) {
         $this->_set_autolang();
         if (!$this->_is_installed && !preg_match('#^install/#', uri_string())) {
             redirect('install/setup');
             exit;
         } elseif (!$this->_is_installed && $this->_is_upgradable) {
             redirect('install/setup');
             exit;
         } elseif ($this->_is_installed && isset($this->CI->config->config['is_installed'])) {
             redirect('home');
         }
         return;
     } elseif (!$this->_is_installed && !preg_match('#^(install|setup|step\\d)#', $_SERVER['REQUEST_URI'])) {
         redirect('install/setup');
     } elseif ($this->_is_upgradable && !preg_match('#^install#', uri_string())) {
         $this->CI->load->driver('session');
         $this->_get_config();
         $this->_get_locale();
         redirect('install/update');
         exit;
     } elseif ($this->CI->config->config['is_installed'] && preg_match('#^(install|setup|step\\d)#', uri_string()) && $this->_db_installed() && !$this->_is_upgradable) {
         redirect('home');
     }
     if ($this->_db_installed() === FALSE) {
         return;
     }
     $this->CI->load->driver('session');
     // Load 2 helpers
     $this->CI->load->helper(array('url', 'cssbutton'));
     // Setup group config object
     $this->group_config = new stdClass();
     // Get the active skin name
     log_message('debug', 'Getting started for Skin.');
     $this->_get_skin();
     // Get the sitewide config settings
     log_message('debug', 'Getting started for Config.');
     $this->_get_config();
     // Get the user locale
     $this->_get_locale();
     $this->CI->lang->set_locale($this->locale);
     // Get the user group config settings for the accessing user
     $this->get_group();
     // Define system wide view vars
     $this->CI->load->vars(array('base_url' => base_url(), 'server_url' => base_url(), 'skin' => $this->skin));
     // Load General Functions and XU API
     //$this->CI->load->library(array('functions', 'xu_api'));
     //define('XU_VERSION_READ', $this->CI->functions->parse_version(XU_VERSION));
     //define('XU_DB_VERSION_READ', $this->CI->functions->parse_version($this->db_version));
     // Load site menus
     $this->_setup_menu();
     // Load the Files Subsystem and the USers subsystem
     $this->CI->load->model(array('users', 'files/files_db', 'admin_logger'));
     // load all custom startup files
     $this->_run_startup();
 }
コード例 #4
0
      </tr>

      <tr>
        <td colspan=4><br><h2><?php 
printf("%s", gettext("Miscellaneous"));
?>
</h2></td>
      </tr>
      <tr>
        <td><?php 
printf("%s:", gettext("Language"));
?>
</td>
        <td><SELECT NAME="pref[LANGUAGE]">
          <?php 
foreach (available_lang() as $lang) {
    if ($lang == $personal["language"]) {
        printf("<OPTION SELECTED> %s </OPTION>", $lang);
    } else {
        printf("<OPTION> %s </OPTION>", $lang);
    }
}
?>
          </SELECT>
          </td>
        <td>&nbsp;</td>
        <td>
<?php 
printf("%s: ", gettext("Current"));
if (isset($personal["language"])) {
    echo "\"{$personal['language']}\"";
コード例 #5
0
ファイル: User.php プロジェクト: rexcarnation/XtraUpload-1
 /**
  * User::edit()
  *
  * Edit user
  *
  * @access	public
  * @param	int		$id	User ID
  * @return	void
  */
 public function edit($id)
 {
     $config = array(array('field' => 'email', 'label' => lang('Email'), 'rules' => 'trim|valid_email'), array('field' => 'username', 'label' => lang('Username'), 'rules' => 'trim|callback_check_user'), array('field' => 'password', 'label' => lang('Password'), 'rules' => 'trim|min_length[5]|max_length[70]'));
     $this->form_validation->set_rules($config);
     if ($this->form_validation->run() == FALSE) {
         $this->form_validation->set_error_delimiters('<li>', '</li>');
         $error = validation_errors();
         if ($this->input->post('edited')) {
             $data['error'] = '<span class="alert"><strong>' . lang('Error:') . '</strong><br><ul>' . $error . '</ul></span>';
         } else {
             $data['error'] = '';
         }
     } else {
         $this->users_db->edit_user($id, $this->input->post('username'), $this->input->post('password'), $this->input->post('email'), $this->input->post('group'), $this->input->post('locale'));
         $this->session->set_flashdata('msg', lang('User Edited!'));
         redirect('/admin/user/view');
         return true;
     }
     $data['user'] = $this->users_db->get_user_by_id($id);
     $data['groups'] = $this->db->get('groups');
     $data['locales'] = available_lang();
     $this->load->view($this->startup->skin . '/header', array('header_title' => lang('Edit User')));
     $this->load->view($this->startup->skin . '/admin/users/edit', $data);
     $this->load->view($this->startup->skin . '/footer');
 }