<html>
<head>
<title>
Simple Login Class
</title>
<style type="text/css">
.allborder {border:3px solid;}
.allborder td{border:2px solid;}
.allborder th{border:2px solid;}
.border {border:1px solid;padding:0px}
.data{font-weight:bold;font-style:italic}
.header{font-weight:bold;background-color:skyblue;}
.valtable{border:1px solid;}
.number {text-align:center}
td{vertical-align:top;}
input{background-color:skyblue;color:indigo;font-weight:bold;height:30px;}
a, a visited, a active{background-color:skyblue;color:indigo;}
</style>
</head>
<body style="background-color:#F0F0F0">
<h1 style="background-color:black;color:white;">
Simple Login Class by Abhishek Shukla </h1>
<div>
<h2>Introduction</h2>
<p>This is a simplexml based class for easy user management.</p>
<p>One user with "admin" userid is default and has user management capabilities.</p>
<p>Admin can create or delete users and edit their details.</p>
<p>Menu can be customised.</p>
<p>Page html can be passed as a variable or a template.</p>
</div>
<div>
<h2>Live Demo</h2>
<p>Example-1 : Minimal
<a href="example1.php" target="_blank">Click here</a></p>
<p>Example-2 : Simple Customisation
<a href="example2.php" target="_blank">Click here</a></p>
<p>Example-3 : Template Support
<a href="example3.php" target="_blank">Click here</a></p>
Login with user ID:admin and password: admin
</div>
<div>
<h2>Files Used</h2>
<p>class.simpleusersystem.php : Main Class File</p>
<p>user/user.dat : Holds data of Users</p>
</div>
<div>
<h2>Variables and Functions</h2>
<p><b>Variable $userdatfile</b> - defines user data file.</p>
<p><b>Variable $allusers</b> - contains all valid users data.</p>
<p><b>Variable $mydetails</b> - details of logged-in user.</p>
<p><b>Variable $currusers</b> - details of last accessed user.</p>
<p><b>Variable $usertool</b> - user welcome note and utility menu.</p>
<p><b>Variable $fieldcsv</b> - fields for user profile.</p>
<p><b>Variable $headerTemplate</b> - default html before content.</p>
<p><b>Variable $footerTemplate</b> - default html after content.</p>
<p><b>Variable $notices</b> - list of success or error message.</p>
<p><b>Variable $adminurl</b> - base url used in User & Profile management links.</p>
<p><b>Function create_user($ID,$pwd)</b> - Creates New user with given ID & Password</p>
<p><b>Function update_user($user)</b> - Updates User Profile</p>
<p><b>Function delete_user($ID)</b> - Deletes user for given ID. Admin user can't be deleted.</p>
<p><b>Function get_user($ID)</b> - Retrieves Information of User by ID</p>
<p><b>Function login_form($logintemplate="")</b> - Validates login for particular user.</p>
<p><b>Function user_tool($menu="y")</b> - Creates User Welcome Note and basic menu</p>
<p><b>Function manage_user()</b> - User Management for Admin</p>
<p><b>Function user_profile($ID="")</b> - Profile Management for users</p>
<p><b>Function renderHTML($content)</b> - prints html for given content</p>
</div>
<div>
<h2>Class Usage</h2>
<pre>
<?php
require_once("class.simpleusersystem.php");
session_start();
$login=New simple_usersystem();
$thisuser=$login->login_form();
//script to display content pages
include(template.php);
or
renderHTML($content);
?>
</pre>
</div>
</body>
</html>
|