* @package wCMS * @version $Revision: 1.9 $ */ /* $Id: login.php,v 1.9 2005/09/06 12:33:06 streaky Exp $ */ require_once "boot.php"; if ($settings['secure_login'] == true && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")) { $QUERY = $_SERVER['QUERY_STRING'] ? "?{$_SERVER['QUERY_STRING']}" : ""; $path = "https://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}{$QUERY}"; header("Location: {$path}"); } $response = ""; $content_output = ""; // require form page and create $form object require_once path::file("classes") . "form_handling_class.php"; $form_options = array('action' => "login.php", 'method' => "post", 'title' => "User Login", 'description' => "Cookies must be enabled to log in", 'response' => $response, 'smarty' => &$smarty); $form = new form_handling($form_options); $form_item = array('label' => "User Name", 'max_length' => 40, 'name' => "login[username]", 'id' => "login-username", 'size' => 30, 'description' => "", 'value' => "", 'required' => true); $form->add_text_field($form_item); $form_item = array('label' => "User Password", 'max_length' => 40, 'name' => "login[userpass]", 'id' => "login-userpass", 'size' => 30, 'description' => "", 'value' => "", 'required' => true, 'type' => 'password'); $form->add_text_field($form_item); /*$form_item = array ( 'label' => "Remember Me", 'checked' => false, 'name' => "login[remember]", 'id' => "login-remember", 'description' => "Store my user credentials and log me in automatically", ); $form->add_checkbox($form_item);*/ $form->build_fieldset("User Credentials"); $form_item = array('title' => "Submit", 'id' => "submit_form", 'type' => "submit"); $form->add_button($form_item);
// header("Location: {$page}"); } $query = "SELECT cont_id, cont_ident, cont_title FROM {$db_prefix}content ORDER BY cont_ident"; $result = $db->query($query); $rows = $result->fetchAll(MDB2_FETCHMODE_ASSOC); $result->free(); foreach ($rows as $tag_item) { $pages[] = array('value' => $tag_item['cont_id'], 'title' => $tag_item['cont_ident']); if ($tag_item['cont_ident'] == "home_page") { $home_id = $tag_item['cont_id']; } } $path = path::http(); $smarty->assign("breadcrumb", "/ <a href='{$path}'>Home</a> / Editing: {$tag} /"); $query = "SELECT * FROM {$db_prefix}content WHERE cont_ident = " . $db->quote($item, 'text'); $db->setLimit(1); $result = $db->query($query); $rows = $result->fetchAll(MDB2_FETCHMODE_ASSOC); $result->free(); $row = $rows[0]; // require form page and create $form object require_once path::file("classes") . "form_handling_class.php"; $form_options = array('action' => path::http() . "edit.php" . ($_SERVER['QUERY_STRING'] ? "?{$_SERVER['QUERY_STRING']}" : ""), 'method' => "post", 'title' => "Editing: " . ($row['content_title'] != "" ? $row['contenttitle'] : $item), 'description' => "", 'response' => $diff_out ? "<h3>Changes Saved:</h3> (New revision: {$new_rev}){$diff_out}<hr />" : "", 'smarty' => &$smarty); $form = new form_handling($form_options); include path::file("classes") . "forms/edit_content_form.php"; $content_output .= $form->return_form(); unset($form); $smarty->assign("breadcrumb", $page['breadcrumb']); $smarty->assign("page_content", $content_output); output_page(); }