Icy Phoenix

     
 


Post new topic  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 1
 
 
Reply with quote Download Post 
Post CUSTOMIZATION - Adding New Kind Of Users For Preventing Not Auth Acces 
 
To create a new range of users (reg, mod, admins,...) we have to go to the file:

Code: [Download] [Hide] [Select]
includes/constants.php

and there seach for:

Code: [Download] [Hide] [Select]
// User Levels <- Do not change the values of USER or ADMIN
define('DELETED', -1);
define('ANONYMOUS', -1);

define('USER', 0);
define('ADMIN', 1);
define('MOD', 2);
define('GLOBAL_MOD', 3);
define('JUNIOR_ADMIN', 4);


and after that, before the next "//" with the sintax:

Code: [Download] [Hide] [Select]
define('TEXT', NUMBER);


create a new type of user
Ex:

Code: [Download] [Hide] [Select]
define('GREAT_ADMIN', 5)


So we´ve changed the red coloured zones.
NOTE THAT: we´ve choosed the number 5, but you can put any number that you want in that zone.

ANOTHER NOTE: the valve "GREAT_ADMIN" is an example, you can put what you want


=============================================================================

UTILITY: you can use this to disallow ohers admins to entry into the file

Code: [Download] [Hide] [Select]
adm/admin_db_utilities.php


by typying at the start of the file (easymod style):
Code: [Download] [Hide] [Select]

-----------SEARCH-------------------

$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);

-----------AFTER, ADD---------------

if( $userdata['user_level'] != ADMIN && $userdata['user_id'] != 2 )
redirect($phpbb_root_path . 'errors.'.$phpbbEx.'?code=401');



==================================================================

NOTE: You can use this in any file.


----------------------------------------------------

How to modify the rank of auths:

Enter into a db manager with editor.

GO to the table "prefix+users"
Modify the user to apply auth
In "user_level" put the number of the define command.

That´s all.
 



 
Edited by Mighty Gorgon, Thu 26 Jul, 2007 00:18: Edited By MG
Edited by novice programmer, Fri 27 Jul, 2007 21:21: edited code by compatybilyty reasons
novice programmerSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Adding New Kind Of Users For Preventing Not Auth Acces 
 
Thanks for this tutorial... I've edited your message inserting HIGHLIGHT command in code instead of COLOR BBCode which is not working in CODE tag.

Finally I would just to add that if you define a constant is because you don't want to remember all the number assigned... so, for example if you put:
Code: [Download] [Hide]
  1. $user_level == ADMIN 


is perfectly identical to
Code: [Download] [Hide]
  1. $user_level == 1 


Because you set ADMIN = 1 as a constant.

Finally if you define new users type, you need then to specify elsewhere how a user can have a different level... otherwise you need to change each user level directly into phpMyAdmin.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Adding New Kind Of Users For Preventing Not Auth Acces 
 
novice programmer wrote: [View Post]

How to modify the rank of auths:

Enter into a db manager with editor.

GO to the table "prefix+users"
Modify the user to apply auth
In "user_level" put the number of the define command.

That´s all.


That explain how to change, as you said with:

Mighty Gorgon wrote: [View Post]

Finally if you define new users type, you need then to specify elsewhere how a user can have a different level... otherwise you need to change each user level directly into phpMyAdmin.

 



 
novice programmerSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Adding New Kind Of Users For Preventing Not Auth Acces 
 
Thanks for explains & changes.

There is another tho things:

If you want to disallow all users to entry the file put (easymod style):

Code: [Download] [Hide] [Select]

-----------[SEARCH]---------------------

$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_selects.' . $phpEx);

------------[AFTER, ADD]------------------

redirect('/errors.'.$phpEx.'?code=401');



WARING: THIS WILL DISALLOW YOURSELF TO ENTER THAT FILE!!!
 



 
novice programmerSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Adding New Kind Of Users For Preventing Not Auth Acces 
 
for allow only the first user entry (easymod style):

Code: [Download] [Hide] [Select]

---------[SEARCH]-------------------------------

require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_selects.' . $phpEx);

--------[AFTER, ADD]---------------------------

if ( $userdata['user_id'] != 2)
redirect('/errors.'.$phpEx.'?code=401');



That´s all.
 



 
novice programmerSend private message  
Back to topPage bottom
Post new topic  This topic is locked: you cannot edit posts or make replies.  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events