PHP Classes

File: readme.txt

Recommend this page to a friend!
  Classes of zinsou A.A.E.Moïse   tinyUGatMs   readme.txt   Download  
File: readme.txt
Role: Documentation
Content type: text/plain
Description: readme
Class: tinyUGatMs
Manage users and groups of events in a database
Author: By
Last change: correct some typos
Date: 5 years ago
Size: 5,079 bytes
 

Contents

Class file image Download
tinyGatMs package is simple users and groups recurring access time management system. technolgies used: -PHP of course -MySql -AJAX(JAVASCRIPT) -HTML5 -for the css it's minimalist you will see what to do with that Features: -Class for groups management(validation, creation, suppression) -Class for users management(registration, validation, creation, suppression) -Management area based on user's role, actually it is set on Admin allowed only(fully used of ajax only) -Users registration with ajax using PDO to connect to MySql *check of already used mail or already used username (ajax) *send of validation mail(ajax) -Users connexion with ajax using PDO to connect to MySql *check of username existence(ajax) *check of true password(ajax) *check of access time (ajax) with message to tell you when to connect if you can't at the moment you try. *not register? link *forget password link -Users password recovering page and reset mail sending using ajax *mail prompt *password changing after mail validation with unique id -Management of users *Edit properties like activation statut,role,password,group for access time etc... *Add a new user *Delete an user -Management of Groups *Edit properties like name,description,access time,access time recurrence,starting date to apply the access time, etc... By default we make the FIRST GROUP permanent with dayly connexion with 00h-23h59.This is the default group for all the new users.You can't renamed it with management panel nor delete it but you could in the database directly or by building your own query to delete or rename it.However you must modify the name if you do it in all the files that used it to avoid bug because when you delete a group, all the users belong to this group were sent in FIRST GROUP for not making them loose access to your website. *Add a new group *Delete an existing group. Keep in mind that: the system is minimalist and can be extended like you want... For the test go to connexion.php and use one of the two user account already created: zinsou password zinsou or manuel password 0123 Classes: -class managemyusers{ protected $properties,$bdd; public function __construct(PDO $bdd,$user,$password,$firstname,$lastname,$email,$groupid,$role,$statutvalidation){ } public function properties(){ return $this->properties; } public function add(){ INSERT IGNORE INTO users (username,password,mail,dateinscription,groupid,firstname,lastname,role,statutvalidation) VALUES (:user,:password,:mail,:dateinscription,:groupid,:firstname,:lastname,:role,:statutvalidation) "); echo'User successfully added'; else return false; } public function update($oldname){ UPDATE users SET username=:user,password=:password,mail=:mail,dateinscription=:dateinscription,groupid=:groupid,firstname=:firstname,lastname=:lastname,role=:role,statutvalidation=:statutvalidation WHERE username=:useroldname'); echo'User successfully updated'; else return false; } } -class groupmyusers{ protected $properties,$bdd; public function __construct(PDO $bdd,$name,$description,$datestart,$startaccesstime,$endaccesstime,$recurrence,$days=''){ } public function properties(){ return $this->properties; } public function add(){ INSERT IGNORE INTO groups (name,description,datecreation,startaccesstime,endaccesstime,recurrence,days,datecreationtimestamp) VALUES (:name,:description,:datestart,:startaccesstime,:endaccesstime,:recurrence,:days,:datestartimestamp) "); echo'Group successfully added'; else return false; } public function update($oldname){ UPDATE groups SET description=:description,datecreation=:datestart,startaccesstime=:startaccesstime, endaccesstime=:endaccesstime,recurrence=:recurrence,days=:days,datecreationtimestamp=:datestartimestamp WHERE name=:oldname echo'Group successfully updated'; else return false; } } Functions: -function inrangetime($x,$y,$z) *$x,$y,$z are array(hours=>value,minutes=>value,seconds=>value) *use inrangetime(array(0,56,56),array(9,56,56),array(23,00,00)) *location ('usefullfunctions.php') -function dologout() *location ('usefullfunctions.php') -function reccurence_reached($x,$y) *$x (here we use start date for group access time timestamp) but you can use any other timestamp for other purposes. *$y={'dayly','weekly','monthly','quartely','yearly'} for this $recurrence=array('dayly'=>1,'weekly'=>7,'monthly'=>30,'quartely'=>90,'yearly'=>365); BUG reporting and feedback to leizmo@gmail.com or you can simply used dedicated forum on the PHPCLASSES site.