コード例 #1
0
ファイル: extplorer.php プロジェクト: jramsey08/Coldwebs-V2.0
    function onShowLoginForm($User, $Pass)
    {
        ?>
	{
		xtype: "form",
		<?php 
        if (!ext_isXHR()) {
            ?>
renderTo: "adminForm", <?php 
        }
        ?>
		title: "<?php 
        echo ext_Lang::msg('actlogin');
        ?>
",
		id: "simpleform",
		labelWidth: 125, // label settings here cascade unless overridden
		url: "<?php 
        echo basename($GLOBALS['script_name']);
        ?>
",
		frame: true,
		keys: {
		    key: Ext.EventObject.ENTER,
		    fn  : function(){
				if (simple.getForm().isValid()) {
					Ext.get( "statusBar").update( "Please wait..." );
					Ext.getCmp("simpleform").getForm().submit({
						reset: false,
						success: function(form, action) { location.reload() },
						failure: function(form, action) {
							if( !action.result ) return;
							Ext.Msg.alert('<?php 
        echo ext_Lang::err('error', true);
        ?>
', action.result.error, function() {
							this.findField( 'password').setValue('');
							this.findField( 'password').focus();
							}, form );
							Ext.get( 'statusBar').update( action.result.error );
						},
						scope: Ext.getCmp("simpleform").getForm(),
						params: {
							option: "com_extplorer", 
							action: "login",
							type : "extplorer"
						}
					});
    	        } else {
        	        return false;
            	}
            }
		},
		items: [{
            xtype:"textfield",
			fieldLabel: "<?php 
        echo ext_Lang::msg('miscusername', true);
        ?>
",
			name: "username",
                        value: "<?php 
        echo $User;
        ?>
",
			width:175,
			allowBlank:false
		},{
			xtype:"textfield",
			fieldLabel: "<?php 
        echo ext_Lang::msg('miscpassword', true);
        ?>
",
			name: "password",
                        value: "<?php 
        echo $Pass;
        ?>
",
			inputType: "password",
			width:175,
			allowBlank:false
		}, new Ext.form.ComboBox({
			
			fieldLabel: "<?php 
        echo ext_Lang::msg('misclang', true);
        ?>
",
			store: new Ext.data.SimpleStore({
		fields: ['language', 'langname'],
		data :	[
		<?php 
        $langs = get_languages();
        $i = 0;
        $c = count($langs);
        foreach ($langs as $language => $name) {
            echo "['{$language}', '{$name}' ]";
            if (++$i < $c) {
                echo ',';
            }
        }
        ?>
			]
	}),
			displayField:"langname",
			valueField: "language",
			value: "<?php 
        echo ext_Lang::detect_lang();
        ?>
",
			hiddenName: "lang",
			disableKeyFilter: true,
			editable: false,
			triggerAction: "all",
			mode: "local",
			allowBlank: false,
			selectOnFocus:true
		}),
		{
			xtype: "displayfield",
			id: "statusBar"
		}
		],
		buttons: [{
			text: "<?php 
        echo ext_Lang::msg('btnlogin', true);
        ?>
", 
			type: "submit",
			handler: function() {
				Ext.get( "statusBar").update( "Please wait..." );
				Ext.getCmp("simpleform").getForm().submit({
					reset: false,
					success: function(form, action) { location.reload() },
					failure: function(form, action) {
						if( !action.result ) return;
						Ext.Msg.alert('<?php 
        echo ext_Lang::err('error', true);
        ?>
', action.result.error, function() {
							this.findField( 'password').setValue('');
							this.findField( 'password').focus();
							}, form );
						Ext.get( 'statusBar').update( action.result.error );
						
					},
					scope: Ext.getCmp("simpleform").getForm(),
					params: {
						option: "com_extplorer", 
						action: "login",
						type : "extplorer"
					}
				});
			}
		},<?php 
        if (!ext_isXHR()) {
            ?>
		{
			text: '<?php 
            echo ext_Lang::msg('btnreset', true);
            ?>
', 
			handler: function() { simple.getForm().reset(); } 
		}
		<?php 
        } else {
            ?>
		{
			text: "<?php 
            echo ext_Lang::msg('btncancel', true);
            ?>
", 
			handler: function() { Ext.getCmp("dialog").destroy(); }
		}
		<?php 
        }
        ?>
		]
	}
	
	<?php 
    }
コード例 #2
0
ファイル: extplorer.init.php プロジェクト: kostya1017/our
define("_EXT_PATH", realpath(dirname(__FILE__) . '/../../administrator/components/com_extplorer'));
define("_EXT_URL", $mosConfig_live_site . "/administrator/components/com_extplorer");
require _EXT_PATH . "/application.php";
require _EXT_PATH . "/libraries/File_Operations.php";
require _EXT_PATH . "/include/functions.php";
require _EXT_PATH . "/include/header.php";
require _EXT_PATH . "/include/result.class.php";
if (!class_exists('InputFilter')) {
    require_once _EXT_PATH . '/libraries/inputfilter.php';
}
$GLOBALS['ERROR'] = '';
$GLOBALS['__GET'] =& $_GET;
$GLOBALS['__POST'] =& $_POST;
$GLOBALS['__SERVER'] =& $_SERVER;
$GLOBALS['__FILES'] =& $_FILES;
$default_lang = !empty($GLOBALS['mosConfig_lang']) ? $GLOBALS['mosConfig_lang'] : ext_Lang::detect_lang();
echo $default_lang;
if (file_exists(_EXT_PATH . "/languages/{$default_lang}.php")) {
    require _EXT_PATH . "/languages/{$default_lang}.php";
} else {
    require _EXT_PATH . "/languages/english.php";
}
if (file_exists(_EXT_PATH . "/languages/" . $default_lang . "_mimes.php")) {
    require _EXT_PATH . "/languages/" . $default_lang . "_mimes.php";
} else {
    require _EXT_PATH . "/languages/english_mimes.php";
}
require _EXT_PATH . "/config/mimes.php";
// the filename of the QuiXplorer script: (you rarely need to change this)
if ($_SERVER['SERVER_PORT'] == 443) {
    $GLOBALS["script_name"] = "https://" . $GLOBALS['__SERVER']['HTTP_HOST'] . $GLOBALS['__SERVER']["PHP_SELF"];
コード例 #3
0
ファイル: login.php プロジェクト: shamblett/janitor
function login()
{
    if (!empty($GLOBALS['__SESSION']["s_user"])) {
        if (!activate_user($GLOBALS['__SESSION']["s_user"], $GLOBALS['__SESSION']["s_pass"])) {
            logout();
        }
    } else {
        if (isset($GLOBALS['__POST']["p_pass"])) {
            $p_pass = $GLOBALS['__POST']["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($GLOBALS['__POST']["p_user"])) {
            // Check Login
            if (!activate_user(stripslashes($GLOBALS['__POST']["p_user"]), extEncodePassword(stripslashes($p_pass)))) {
                ext_Result::sendResult('login', false, ext_Lang::msg('actlogin_failure'));
            }
            ext_Result::sendResult('login', true, ext_Lang::msg('actlogin_success'));
        } else {
            session_write_close();
            session_id(get_session_id());
            session_start();
            // Ask for Login
            $GLOBALS['mainframe']->setPageTitle(ext_Lang::msg('actlogin'));
            $GLOBALS['mainframe']->addcustomheadtag('
		<script type="text/javascript" src="' . _EXT_URL . '/fetchscript.php?' . '&amp;subdir[0]=scripts/extjs/&amp;file[0]=yui-utilities.js' . '&amp;subdir[1]=scripts/extjs/&amp;file[1]=ext-yui-adapter.js' . '&amp;subdir[2]=scripts/extjs/&amp;file[2]=ext-all.js&amp;gzip=1"></script>
		<script type="text/javascript" src="' . $GLOBALS['script_name'] . '?option=com_extplorer&amp;action=include_javascript&amp;file=functions.js"></script>	
		<link rel="stylesheet" href="' . _EXT_URL . '/fetchscript.php?subdir[0]=scripts/extjs/css/&file[0]=ext-all.css&amp;subdir[1]=scripts/extjs/css/&file[1]=xtheme-aero.css&amp;gzip=1" />');
            $langs = get_languages();
            ?>
		<div id="formContainer">
			<?php 
            show_footer();
            ?>
	    	<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
	    	<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
	
	        <h3 style="margin-bottom:5px;"><?php 
            echo ext_Lang::msg('actlogin');
            ?>
</h3>
	        <div id="adminForm">
	
	        </div><div class="ext_statusbar" id="statusBar"></div>
	    	</div></div></div>
	    	<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
	    	
	</div>
	<script type="text/javascript">
	var languages = new Ext.data.SimpleStore({
	    fields: ['language', 'langname'],
	    data :  [
	    <?php 
            $i = 0;
            $c = count($langs);
            foreach ($langs as $language => $name) {
                echo "['{$language}', '{$name}' ]";
                if (++$i < $c) {
                    echo ',';
                }
            }
            ?>
	        ]
	});
	var simple = new Ext.form.Form({
	    labelWidth: 125, // label settings here cascade unless overridden
	    url:'<?php 
            echo basename($GLOBALS['script_name']);
            ?>
'
	});
	simple.add(
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
            echo ext_Lang::msg('miscusername', true);
            ?>
',
	        name: 'p_user',
	        width:175,
	        allowBlank:false
	    }),
	    new Ext.form.TextField({
	        fieldLabel: '<?php 
            echo ext_Lang::msg('miscpassword', true);
            ?>
',
	        name: 'p_pass',
	        inputType: 'password',
	        width:175,
	        allowBlank:false
	    }),
		new Ext.form.ComboBox({
			fieldLabel: '<?php 
            echo ext_Lang::msg('misclang', true);
            ?>
',
		    store: languages,
		    displayField:'langname',
		    valueField: 'language',
		    value: '<?php 
            echo ext_Lang::detect_lang();
            ?>
',
		    hiddenName: 'lang',
		    disableKeyFilter: true,
		    editable: false,
		    triggerAction: 'all',
		    mode: 'local',
		    allowBlank: false,
		    selectOnFocus:true
		})
	);
	
	simple.addButton({text: '<?php 
            echo ext_Lang::msg('btnlogin', true);
            ?>
', type: 'submit'}, function() {
		Ext.get( 'statusBar').update( 'Please wait...' );
	    simple.submit({
	        //reset: true,
	        reset: false,
	        success: function(form, action) {	
	        	Ext.get( 'statusBar').update( action.result.message );
			location.href = '<?php 
            echo basename($GLOBALS['script_name']);
            ?>
?extplorer';
	        },
	        failure: function(form, action) {
	        	if( !action.result ) return;
				Ext.MessageBox.alert('Error!', action.result.error);
				Ext.get( 'statusBar').update( action.result.error );
				simple.findField( 'p_pass').setValue('');
				simple.findField( 'p_user').focus();
	        },
	        scope: simple,
	        // add some vars to the request, similar to hidden fields
	        params: {option: 'com_extplorer', 
	        		action: 'login'
	        }
	    })
	});
	simple.addButton('<?php 
            echo ext_Lang::msg('btnreset', true);
            ?>
', function() { simple.reset(); } );
	simple.render('adminForm');
	Ext.get( 'formContainer').center();
	Ext.get( 'formContainer').setTop(100);
	simple.findField('p_user').focus();

</script><?php 
            define('_LOGIN_REQUIRED', 1);
        }
    }
}