PHP Classes

OnTime Group Backend: Manage user groups and their access permissions

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 81 All time: 10,094 This week: 560Up
Version License PHP version Categories
ontimegrp 1.0.1Public Domain5Tools, User Management, Security, PHP 7
Description 

Author

This package can manage user groups and their access permissions.

It provides a classes and trait with functions that implement operations to manage groups of users and the permissions which they may have to access certain resources. Currently it can:

- Create new groups
- Add, change, get and delete a user of a group
- Add, change, get and delete a feature of a group
- Add, change, get and delete public and private information of a group
- Get the groups of a user

Picture of Mario Carrocera
  Performance   Level  
Name: Mario Carrocera is available for providing paid consulting. Contact Mario Carrocera .
Classes: 18 packages by
Country: Mexico Mexico
Age: 59
All time rank: 309536 in Mexico Mexico
Week rank: 164 Up4 in Mexico Mexico Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Example

<?php

ini_set
('display_errors', true);
error_reporting(E_ERROR | E_PARSE | E_NOTICE | E_WARNING);

$base='ontime/';
$AdminPassword='OT2021Free';
include_once(
$base."OnTime.php");
$demo=new OnTime();

echo
"********** <br> Create Class <br> ********** <br> <br>";
$demo->ot_error('basic content exist').'<br>';


echo
"**********+++++++++++ <br> Conecting like admin <br> **********+++++++++++ <br> <br>";
echo
"Connect('admin','OT2021Free') ";
$demo->Connect('admin',$AdminPassword);
echo
"<br>";$demo->ot_error("Connected!!!");echo "<br>";



echo
"**********+++++++++++ <br> Create Demostrion user <br> **********+++++++++++ <br> <br>";
$demo->CrtUsr('Demo','12345','active','Demostration user','Demo 1');
echo
"<br>";$demo->ot_error("create!!!");echo "<br>";
$demo->CrtUsr('DEMO','12345','active','Demostration user','Demo 2');
echo
"<br>";$demo->ot_error("create!!!");echo "<br>";
$demo->CrtUsr('demo','12345','active','Demostration user','Demo 3');
echo
"<br>";$demo->ot_error("create!!!");echo "<br>";

echo
"**********+++++++++++ <br> Group <br> **********+++++++++++ <br> <br>";
echo
"********** <br> Adding <br> **********+ <br> <br>";
echo
"CrtGrp('Administrators','Administrators for the main Feature','admins')";
$demo->CrtGrp('Administrators','Administrators for the main Feature','admins');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"CrtGrp('Everyone','All users','EvrAll')";
$demo->CrtGrp('Everyone','All users','EvrAll');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"CrtGrp('AdminUsers','Administrators on User Featrute','AUser')";
$demo->CrtGrp('AdminUsers','Administrators on User Featrute','AUser');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"CrtGrp('AdminGroups','Administrators on Group Featrute','AGroup')";
$demo->CrtGrp('AdminGroups','Administrators on User Featrute','AGroup');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";

echo
"********** <br> Show All <br> **********+ <br> <br>";
echo
"GrpShwAll()";
$demo->ot_show($demo->GrpShwAll());

echo
"********** <br> Show my groups <br> **********+ <br> <br>";
echo
"->groups";
$demo->ot_show($demo->groups);


echo
"**********+++++++++++ <br> Group & User <br> **********+++++++++++ <br> <br>";
echo
"********** <br> Adding <br> **********+ <br> <br>";
echo
"GrpAddUsr('Everyone','DEMO','access')";
$demo->GrpAddUsr('Everyone','DEMO','access');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpAddUsr('AdminGroups','DEMO','owner')";
$demo->GrpAddUsr('AdminGroups','DEMO','owner');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpAddUsr('AdminGroups','Demo','create')";
$demo->GrpAddUsr('AdminGroups','Demo','create');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpAddUsr('AdminGroups','demo','access')";
$demo->GrpAddUsr('AdminGroups','demo','access');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"********** <br> Show Users in AdminGroups <br> **********+ <br> <br>";
echo
"GrpShwUsr('AdminGroups')";
$demo->ot_show($demo->GrpShwUsr('AdminGroups'));
echo
"GrpChgUsr('Everyone','demo','access')";
$demo->GrpChgUsr('Everyone','demo','access');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpChgUsr('AdminGroups','demo','change')";
$demo->GrpChgUsr('AdminGroups','demo','change');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"********** <br> Show Users in AdminGroups <br> **********+ <br> <br>";
echo
"GrpShwUsr('AdminGroups')";
$demo->ot_show($demo->GrpShwUsr('AdminGroups'));
echo
"GrpDltUsr('Everyone','demo')";
$demo->GrpDltUsr('Everyone','demo');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpDltUsr('AdminGroups','demo')";
$demo->GrpDltUsr('AdminGroups','demo');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"********** <br> Show Users in AdminGroups <br> **********+ <br> <br>";
echo
"GrpShwUsr('AdminGroups')";
$demo->ot_show($demo->GrpShwUsr('AdminGroups'));

echo
"**********+++++++++++ <br> Group & Features <br> **********+++++++++++ <br> <br>";
echo
"********** <br> Adding <br> **********+ <br> <br>";
echo
"GrpAddFtr('Everyone','DEMO','access')";
$demo->GrpAddFtr('Everyone','DEMO','access');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpAddFtr('Everyone','usr','access')";
$demo->GrpAddFtr('Everyone','usr','access');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpAddFtr('Everyone','grp','access')";
$demo->GrpAddFtr('Everyone','grp','access');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"GrpAddFtr('AdminGroups','grp','owner')";
$demo->GrpAddFtr('AdminGroups','grp','owner');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"********** <br> Show Features in AdminGroups <br> **********+ <br> <br>";
echo
"GrpShwFtr('AdminGroups')";
$demo->ot_show($demo->GrpShwFtr('AdminGroups'));
echo
"********** <br> Show Features in Everyone <br> **********+ <br> <br>";
echo
"GrpShwFtr('Everyone')";
$demo->ot_show($demo->GrpShwFtr('Everyone'));
echo
"********** <br> Show group for feture grp <br> **********+ <br> <br>";
echo
"FtrShwGrp('grp')";
$demo->ot_show($demo->FtrShwGrp('grp'));
echo
"********** <br> Show User Safety <br> **********+ <br> <br>";
echo
"FtrShwGrp('DEMO')";
$demo->ot_show($demo->Safety('DEMO'));
echo
"********** <br> Add User Demo to Feature grp <br> **********+ <br> <br>";
echo
"UsrAddFtr('grp','DEMO','change')";
$demo->UsrAddFtr('grp','DEMO','change');
echo
"<br>";$demo->ot_error("Added!!!");echo "<br>";
echo
"********** <br> Show User Safety <br> **********+ <br> <br>";
echo
"FtrShwGrp('DEMO')";
$demo->ot_show($demo->Safety('DEMO'));
echo
"********** <br> Adding <br> **********+ <br> <br>";
echo
"GrpAddFtr('Everyone','user','change')";
$demo->GrpAddFtr('Everyone','user','change');
echo
"<br>";$demo->ot_error("Changed!!!");echo "<br>";
echo
"GrpAddFtr('Everyne','usr','change')";
$demo->GrpAddFtr('Everyne','usr','change');
echo
"<br>";$demo->ot_error("Changed!!!");echo "<br>";
echo
"GrpAddFtr('Everyone','usr','change')";
$demo->GrpAddFtr('Everyone','usr','change');
echo
"<br>";$demo->ot_error("Changed!!!");echo "<br>";
echo
"********** <br> Show group for feture grp <br> **********+ <br> <br>";
echo
"FtrShwGrp('grp')";
$demo->ot_show($demo->FtrShwGrp('grp'));
echo
"********** <br> deleting <br> **********+ <br> <br>";
echo
"GrpDltFtr('Everyone','user','change')";
$demo->GrpDltFtr('Everyone','user','change');
echo
"<br>";$demo->ot_error("Deleted!!!");echo "<br>";
echo
"GrpDltFtr('Everyne','usr','change')";
$demo->GrpDltFtr('Everyne','usr','change');
echo
"<br>";$demo->ot_error("Deleted!!!");echo "<br>";
echo
"GrpDltFtr('Everyone','usr','change')";
$demo->GrpDltFtr('Everyone','usr','change');
echo
"<br>";$demo->ot_error("Deleted!!!");echo "<br>";
echo
"********** <br> Show group for feture grp <br> **********+ <br> <br>";
echo
"FtrShwGrp('grp')";
$demo->ot_show($demo->FtrShwGrp('grp'));

echo
"**********+++++++++++ <br> Group & Info <br> **********+++++++++++ <br> <br>";
echo
"********** <br> Group Public Information <br> ********** <br> <br>";
echo
"GrpAddPbl('Everyone',,'one record','the information i wana share')"."<br>";
$demo->GrpAddPbl('Everyone','one record','the information i wana share');
$demo->ot_error("Asigned!!!")."<br>";

echo
"GrpAddPbl('Everyone','who','askme to ad u')"."<br>";
$demo->GrpAddPbl('Everyone','who','askme to ad u');
$demo->ot_error("Asigned!!!")."<br>";

echo
"GrpShwPbl('Everyone')"."<br>";
$demo->ot_show($demo->GrpShwPbl('Everyone'));

echo
"GrpChgPbl('Everyone','who','askme to add you')"."<br>"."<br>";
$demo->GrpChgPbl('Everyone','who','askme to add you');
$demo->ot_error("Changed!!!")."<br>";

echo
"GrpShwPbl('Everyone')"."<br>";
$demo->ot_show($demo->GrpShwPbl('Everyone'));

echo
"GrpDltPbl('Everyone','one record')"."<br>"."<br>";
$demo->GrpDltPbl('Everyone','one record');
$demo->ot_error("Delete!!!")."<br>";

echo
"GrpShwPbl('Everyone')"."<br>";
$demo->ot_show($demo->GrpShwPbl('Everyone'));

echo
"********** <br> Group Private Information <br> ********** <br> <br>";
echo
"GrpAddPrv('Everyone',,'alpha','is a secret')"."<br>";
$demo->GrpAddPrv('Everyone','alpha','is a secret');
$demo->ot_error("Asigned!!!")."<br>";

echo
"GrpAddPrv('Everyone','beta','askme to ad u')"."<br>";
$demo->GrpAddPrv('Everyone','beta','askme to ad u');
$demo->ot_error("Asigned!!!")."<br>";

echo
"GrpShwPrv('Everyone')"."<br>";
$demo->ot_show($demo->GrpShwPrv('Everyone'));

echo
"GrpChgPrv('Everyone','beta','askme to add you')"."<br>"."<br>";
$demo->GrpChgPrv('Everyone','beta','askme to add you');
$demo->ot_error("Changed!!!")."<br>";

echo
"GrpShwPrv('Everyone')"."<br>";
$demo->ot_show($demo->GrpShwPrv('Everyone'));

echo
"GrpDltPrv('Everyone','beta')"."<br>"."<br>";
$demo->GrpDltPrv('Everyone','beta');
$demo->ot_error("Delete!!!")."<br>";

echo
"GrpShwPrv('Everyone')"."<br>";
$demo->ot_show($demo->GrpShwPrv('Everyone'));

echo
"DltGrp('Mine')";
$demo->DltGrp('Mine');
$demo->ot_error("Delete!!!");

echo
"DltGrp('Everyone')";
$demo->DltGrp('Everyone');
$demo->ot_error("Delete!!!");


echo
"**********+++++++++++ <br> Demo Finish<br> **********+++++++++++ <br> <br>";
?>


Details

Trait Groups for ontime

The OnTime framework is designed to be modular, scalable and comprehensive, so that each new feature integrates without difficulty and maintains a unique class definition (OnTime) and all "additional classes" are "trait" that enrich it, in such a way that an integrated system is obtained, not separate programs which do not necessarily have to behave correctly together. This trait is optional bur recomended to manege security, can join user to the groups, and include groups in features.

Installation in test environment:

1.- Copy all the files in the directory where was instaled ontrime core

2.- With the browser of your preference, locate the directory and enter it

3.- Execute the OntimeInstallerGrp.php file

4.- When executing the file, the files where moved and the required environment was created

Recommendations:

If you know how to create a subdomain that points to the "demo" directory, it is more comfortable and realistic.

After install

When installing, the necessary environment is defined to define access security, I create a User called "Admin" and that his password is "OT2021Free", this environment left the class prepared for the control of Groups

Is very important undertand how the security is asigned, first look in all groups thet the use have, and find the best level in any group, when is finish find the security asigned to the user, if the feature is assigne directo to an user is that the level, don'tcare is in the groups is better or worst level.

mario.carrocera@hotmail.com

+++++++++++ Gruop Demo +++++++++++

Create Class

basic content exist +++++++++++ Conecting like admin +++++++++++

Connect('admin','OT2021Free') Connected!!!

+++++++++++ Create Demostrion user +++++++++++

C0010M007.-Record exist

C0010M007.-Record exist

C0010M007.-Record exist

+++++++++++ Group +++++++++++

Adding +

CrtGrp('Administrators','Administrators for the main Feature','admins') C0010M007.-Record exist

CrtGrp('Everyone','All users','EvrAll') Added!!!

CrtGrp('AdminUsers','Administrators on User Featrute','AUser') C0010M007.-Record exist

CrtGrp('AdminGroups','Administrators on Group Featrute','AGroup') C0010M007.-Record exist

Show All +

GrpShwAll() 0D.- AdminGroups=>Administrators on User Featrute(AGroup) 0D.- AdminUsers=>Administrators on User Featrute(AUser) 0D.- Administrators=>Administrators for the main Feature(admins) 0D.- Everyone=>All users(EvrAll) Show my groups +

->groups 0D.- Administrators=>owner 0D.- AdminUsers=>owner 0D.- AdminGroups=>owner +++++++++++ Group & User +++++++++++

Adding +

GrpAddUsr('Everyone','DEMO','access') C0010M012.-Not autorized

GrpAddUsr('AdminGroups','DEMO','owner') C0010M007.-Record exist

GrpAddUsr('AdminGroups','Demo','create') C0010M007.-Record exist

GrpAddUsr('AdminGroups','demo','access') Added!!!

Show Users in AdminGroups +

GrpShwUsr('AdminGroups') 0D.- admin=>owner 0D.- DEMO=>owner 0D.- Demo=>create 0D.- demo=>access GrpChgUsr('Everyone','demo','access') C0010M012.-Not autorized

GrpChgUsr('AdminGroups','demo','change') Added!!!

Show Users in AdminGroups +

GrpShwUsr('AdminGroups') 0D.- admin=>owner 0D.- DEMO=>owner 0D.- Demo=>create 0D.- demo=>change GrpDltUsr('Everyone','demo') C0010M012.-Not autorized

GrpDltUsr('AdminGroups','demo') Added!!!

Show Users in AdminGroups +

GrpShwUsr('AdminGroups') 0D.- admin=>owner 0D.- DEMO=>owner 0D.- Demo=>create +++++++++++ Group & Features +++++++++++

Adding +

GrpAddFtr('Everyone','DEMO','access') C0010M012.-Not autorized

GrpAddFtr('Everyone','usr','access') Added!!!

GrpAddFtr('Everyone','grp','access') Added!!!

GrpAddFtr('AdminGroups','grp','owner') C0010M007.-Record exist

Show Features in AdminGroups +

GrpShwFtr('AdminGroups') 0D.- grp=>owner Show Features in Everyone +

GrpShwFtr('Everyone') 0D.- usr=>access 0D.- grp=>access Show group for feture grp +

FtrShwGrp('grp') 0D.- AdminGroups=>owner 0D.- Everyone=>access Show User Safety +

FtrShwGrp('DEMO') 0D.- grp=>change Add User Demo to Feature grp +

UsrAddFtr('grp','DEMO','change') C0010M007.-Record exist

Show User Safety +

FtrShwGrp('DEMO') 0D.- grp=>change Adding +

GrpAddFtr('Everyone','user','change') C0010M012.-Not autorized

GrpAddFtr('Everyne','usr','change') C0010M008.-Record don't exist

GrpAddFtr('Everyone','usr','change') C0010M007.-Record exist

Show group for feture grp +

FtrShwGrp('grp') 0D.- AdminGroups=>owner 0D.- Everyone=>access deleting +

GrpDltFtr('Everyone','user','change') C0010M012.-Not autorized

GrpDltFtr('Everyne','usr','change') C0010M008.-Record don't exist

GrpDltFtr('Everyone','usr','change') Deleted!!!

Show group for feture grp +

FtrShwGrp('grp') 0D.- AdminGroups=>owner 0D.- Everyone=>access +++++++++++ Group & Info +++++++++++

Group Public Information

GrpAddPbl('Everyone',,'one record','the information i wana share') Asigned!!! GrpAddPbl('Everyone','who','askme to ad u') Asigned!!! GrpShwPbl('Everyone')

0D.- one record=>the information i wana share 0D.- who=>askme to ad u GrpChgPbl('Everyone','who','askme to add you')

Changed!!! GrpShwPbl('Everyone')

0D.- one record=>the information i wana share 0D.- who=>askme to add you GrpDltPbl('Everyone','one record')

Delete!!! GrpShwPbl('Everyone')

0D.- who=>askme to add you Group Private Information

GrpAddPrv('Everyone',,'alpha','is a secret') Asigned!!! GrpAddPrv('Everyone','beta','askme to ad u') Asigned!!! GrpShwPrv('Everyone')

0D.- alpha=>is a secret 0D.- beta=>askme to ad u GrpChgPrv('Everyone','beta','askme to add you')

Changed!!! GrpShwPrv('Everyone')

0D.- alpha=>is a secret 0D.- beta=>askme to add you GrpDltPrv('Everyone','beta')

Delete!!! GrpShwPrv('Everyone')

0D.- alpha=>is a secret DltGrp('Mine')C0010M008.-Record don't exist DltGrp('Everyone')Delete!!! +++++++++++ Demo Finish +++++++++++


  Files folder image Files (11)  
File Role Description
Accessible without login Plain text file DemoGrp.php Example Example script
Accessible without login Plain text file licencia Data Auxiliary data
Accessible without login Plain text file license Lic. License text
Plain text file OnTime.php Class Class source
Plain text file OnTimeAllways.php Class Class source
Plain text file OnTimeGrpsA.php Class Class source
Plain text file OnTimeGrpsB.php Class Class source
Accessible without login Plain text file OntimeInstallerGrp.php Example Example script
Plain text file OnTimetmp.php Class Class source
Plain text file OTigrp.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadontimegrp-2021-04-09.zip 9KB
Downloadontimegrp-2021-04-09.tar.gz 7KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
HTML Google Fonts using PHP on Time Download .zip .tar.gz Implement Google Font on HTML Optional
HTML Include Images and Text using PHP on Time Download .zip .tar.gz Implement image & text Optional
HTML Nav bar using PHP on Time Download .zip .tar.gz Implements a Nav Bar Optional
HTML LayOut using PHP on Time Download .zip .tar.gz Implement Layout Optional
HTML CSS Styles using PHP on Time Download .zip .tar.gz Implements Css Html Optional
HTML Metatags using PHP on Time Download .zip .tar.gz Html Meta Tag pacakage Optional
OnTime PHP Multi Language trait Download .zip .tar.gz Add Multilenguage to the database Optional
Easy PHP SOAP Server Web Service Download .zip .tar.gz Add soap webservice server Optional
OnTime Table Trait Download .zip .tar.gz Add table feature with myltiple fields validatied Optional
On Time Data Dictionary and Record Trait Download .zip .tar.gz Add Data Dictuionary and record information Optional
OnTime Timezones and Formats Trait Download .zip .tar.gz Add Date, time & timezones managemt Optional
OnTime Debugger Backend Trait Download .zip .tar.gz Add the ability to debug the class Optional
OnTime Basic Content Trait Backend Download .zip .tar.gz Add Simple 2 field tables Optional
OnTime Core Backend Download .zip .tar.gz Is the main trait, control users and features Required
 Version Control Reuses Unique User Downloads Download Rankings  
 100%8
Total:81
This week:0
All time:10,094
This week:560Up