Example #1
0
function login()
{
    if (isset($_SESSION["s_user"])) {
        _debug("login(): session detected");
        //if ( ! user_activate( $_SESSION["s_user"], $_SESSION["s_pass"] ))
        if (!user_activate($_SESSION["s_user"], base64_decode($_SESSION["s_pass"]))) {
            _debug("Failed to activate user " . $_SESSION['s_user']);
            logout();
        }
    } else {
        if (isset($_POST["p_pass"])) {
            $p_pass = $_POST["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($_POST["p_user"])) {
            _debug("login(): login authentication");
            // Check Login
            //if ( ! user_activate( stripslashes( $_POST["p_user"] ), md5( stripslashes( $p_pass ) ) ) )
            if (!user_activate(stripslashes($_POST["p_user"]), $p_pass)) {
                global $error_msg;
                show_error($error_msg["login_failed"] . ": " . $_POST["p_user"]);
            }
            // authentication sucessfull
            _debug("user '" . $_POST["p_user"] . "' successfully authenticated");
            // set language
            $_SESSION['language'] = qx_request("lang", "en");
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<CENTER><BR><TABLE width=\"300\"><TR><TD colspan=\"2\" class=\"header\" nowrap><B>";
            echo $GLOBALS["messages"]["actloginheader"] . "</B></TD></TR>\n<FORM name=\"login\" action=\"";
            echo make_link("login", NULL, NULL) . "\" method=\"post\">\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscusername"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_user\" type=\"text\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscpassword"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_pass\" type=\"password\" size=\"25\"></TD></TR>\n";
            // NAS4Free Code
            //Select box and auto language detection array
            echo "<TR><TD>" . gettext("Detected Language:<br />(Change if needed)") . "</TD><TD align=\"right\">";
            @(include "./_lang/_info.php");
            // End NAS4Free Code
            echo "<TR><TD colspan=\"2\" align=\"right\"><INPUT type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></TD></TR>\n</FORM></TABLE><BR></CENTER>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
                <!--
                if(document.login) document.login.p_user.focus();
            // -->
            </script><?php 
            show_footer();
            exit;
        }
    }
}
Example #2
0
	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
/*------------------------------------------------------------------------------
			QuiXplorer v2.5.7 Modified for NAS4Free
------------------------------------------------------------------------------*/
umask(02);
// Added to make created files/dirs group writable
require_once "qx.php";
require "./_include/init.php";
// Init
global $action;
_debug("system_filemanager.php: checking action {$action}");
$current_dir = qx_request("dir", "");
switch ($action) {
    // Execute action
    // EDIT FILE
    case "edit":
        require "./_include/edit_editarea.php";
        edit_file($current_dir, $GLOBALS["item"]);
        break;
        // DELETE FILE(S)/DIR(S)
    // DELETE FILE(S)/DIR(S)
    case "delete":
        require "./_include/del.php";
        del_items($current_dir);
        break;
        // COPY/MOVE FILE(S)/DIR(S)
    // COPY/MOVE FILE(S)/DIR(S)