Ejemplo n.º 1
0
 public function deleteuser()
 {
     $user_id = url_decrypt($this->uri->segment(3));
     if (!$user_id || empty($user_id) || !is_numeric($user_id)) {
         show_404();
     }
     if ($this->ion_auth->delete_user($user_id)) {
         $this->session->set_flashdata('success_notify', 'User has been deleted.');
     } else {
         $this->session->set_flashdata('error_notify', $this->ion_auth->messages());
     }
     redirect('users/lists');
 }
Ejemplo n.º 2
0
    exit;
} else {
    if (!isset($_GET['q'])) {
        // must be at homepage - should we redirect somewhere else?
        if (Config::get('index_redirect')) {
            // redirect to...
            header("HTTP/1.1 302 Found");
            header("Location: " . Config::get('index_redirect'));
        } else {
            echo render_template("./templates/main.php", array('version' => Proxy::VERSION));
        }
        exit;
    }
}
// decode q parameter to get the real URL
$url = url_decrypt($_GET['q']);
$proxy = new Proxy();
// load plugins
foreach (Config::get('plugins', array()) as $plugin) {
    $plugin_class = $plugin . 'Plugin';
    if (file_exists('./plugins/' . $plugin_class . '.php')) {
        // use user plugin from /plugins/
        require_once './plugins/' . $plugin_class . '.php';
    } else {
        if (class_exists('\\Proxy\\Plugin\\' . $plugin_class)) {
            // does the native plugin from php-proxy package with such name exist?
            $plugin_class = '\\Proxy\\Plugin\\' . $plugin_class;
        }
    }
    // otherwise plugin_class better be loaded already through composer.json and match namespace exactly \\Vendor\\Plugin\\SuperPlugin
    $proxy->getEventDispatcher()->addSubscriber(new $plugin_class());