Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Co usunąć z kodu żeby został katalog?
Tom:-)
post 19.11.2010, 00:59:06
Post #1





Grupa: Zarejestrowani
Postów: 284
Pomógł: 0
Dołączył: 25.03.2007
Skąd: Globalna wioska

Ostrzeżenie: (0%)
-----


Mam kod:
  1. "/administrator\/*index.?\.php$/i"
I co mam usunąć żeby pozostawić sam katalog?


--------------------
Go to the top of the page
+Quote Post
Crozin
post 19.11.2010, 01:04:56
Post #2





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Pomijając to, że nie wiemy jaki masz dokładnie kod: możesz utworzyć katalog na nowo po jego usunięciu.
Go to the top of the page
+Quote Post
Tom:-)
post 19.11.2010, 01:29:54
Post #3





Grupa: Zarejestrowani
Postów: 284
Pomógł: 0
Dołączył: 25.03.2007
Skąd: Globalna wioska

Ostrzeżenie: (0%)
-----


O to kod z pliku:
Kod
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.plugin.plugin');

class plgSystemJSecure extends JPlugin {
    
    /**
     * Constructor
     *
     * For php4 compatability we must not use the __constructor as a constructor for plugins
     * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
     * This causes problems with cross-referencing necessary for the observer design pattern.
     *
     * @param object $subject The object to observe
     * @since 1.5
     */
    function plgSystemCanonicalization(& $subject, $config) {
        parent :: __construct($subject, $config);
    }
    
    function onAfterDispatch() {
        // Register the needed session variables
        $session =& JFactory::getSession();

        $plugin =& JPluginHelper::getPlugin( 'system', 'jsecure' );
        
        $params = new JParameter($plugin->params);

        $my =& JFactory::getUser();
        $checkedKey = $session->get('jSecureAuthentication');
        $path ='';
        if (empty($checkedKey)) {
            if((preg_match("/administrator\/*index.?\.php$/i", $_SERVER['SCRIPT_NAME']))) {
                if(!$my->id && $params->get('key') != $_SERVER['QUERY_STRING']) {
                    $config =& JFactory::getConfig();
                    $path .= $params->get('options') == 1 ? JURI::root().$params->get('custom_path') : JURI::root();
                    $app =& JFactory::getApplication();
                    $app->redirect($path);
                }  else {
                    $session->set('jSecureAuthentication', 1);
                }
            }
        }
    }
}


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 10:37