login - $login["instructions"] .=...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
<?php < /* * Invision Power File Manager * Login Script * Copyright (c) 2003 Invision Power Services * ------------------------------------- * You may not remove the copyright or * redistribute the script in any form * * Authors: Stephen Ball <stephen@invisionfilemanager.com> * * Last Modified: 22nd February 2003 * */ error_reporting(0); e if (!(include("./modules/header.lib.php"))) { die("<p align=\"center\">There was an error loading the header module</p>"); } if (param("op", "POST") == "validate") { if ($params = auth_user(param("username", "POST"), md5(param("password", "POST")))) { if ($cookie_time != "") { // Find out the time the cookie should last $cookie_time = time() + $cookie_time; } // Set the cookies setcookie($cookie_user, param("username", "POST"), (int) $cookie_time); setcookie($cookie_pass, md5(param("password", "POST")), (int) $cookie_time); setcookie($cookie_lang, param("language", "POST"), (int) $cookie_time); // Forward to the main page redirect($scripts["main"]); } // Error! Add the error message to the instructions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: $login[&quot;instructions&quot;] .= &quot;&lt;br /&gt;&quot; . $login[&quot;error&quot;]; } else if (param(&quot;op&quot;, &quot;GET&quot;) == &quot;out&quot;) { // Unset the cookies setcookie($cookie_user); setcookie($cookie_pass); setcookie($cookie_lang); } // Build the languages drop down list natcasesort($lang_name); $langauges = $login[&quot;my_default&quot;]; foreach ($lang_name as $key =&gt; $var) { if ($key == $default_lang) { $langauges[$key] = $var . &quot; - &quot; . $login[&quot;default&quot;]; } else { $langauges[$key] = $var; } } $lang_list = dropdown($langauges, $lang); $ // The user isn't validated so construct the page $form = template($login, $script_dir . &quot;/settings/templates/login.tpl&quot;); $page = array(&quot;javascript&quot; =&gt; &quot;&quot;, &quot;content&quot; =&gt; $form, &quot;languages&quot; =&gt; $lang_list, &quot;title&quot; =&gt; $login[&quot;title&quot;], &quot;this&quot; =&gt; $PHP_SELF, &quot;copyright&quot; =&gt; $copyright); &quot; // Finish up by outputting the completed page template($page, $script_dir . &quot;/settings/templates/global.tpl&quot;); t ?&gt;...
View Full Document

This note was uploaded on 04/18/2011 for the course CSE 099 taught by Professor Hawkins during the Spring '11 term at N. Arizona.

Page1 / 2

login - $login[&amp;amp;quot;instructions&amp;amp;quot;] .=...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online