[Transfer] release a permission management program

xiaoxiao2021-03-06  20

// Program download address: http://phpx.com/happy/attachment.php?s=&postid=694646 This is just an example program, because of the time relationship, only written some simple applications, other functions, leaning on you slow Slow down. Permissions are eternal topics, if you have anything you don't understand, you can send it to my mailbox. Biedy_sun@eyou.com to ask the product development purpose to use the younger brother's next product OA, is a business program, first Issue this code, I hope everyone likes it. The program has not been tested by Debug, if you are responsible for answering, but all the consequences, I am not responsible

Originally, it is necessary to provide a background instance, but because of the time relationship, it is not available. Just trouble you in the database. Or you can write a background, it should be very simple.

Procedure Run: First, get the Groups of users to get the query statement by meMber_groups_relation to get the query statement, get MemberGroups () methods in the Perm class; secondly get the Groups permission content where the user group is located, this action is obtained by querying Groups_Perm_RELATION. Get. Query statements You can get from the getGroupSperm () method in the Perm class. Next, we have to get additional permissions of this user, which is the permission of the permission group he is located, this operation is obtained by the Member_Perm_ReLATION table, the query statement may refer to the getMemberadDperm () method in the Perm class. After completing the above operation, we have to make permissions merge. Get all this user all permission ID, which is used in Perm, is PID, where the merge array function array_merge () and array_unique () Remove the repeated value function in the array, you can check the manual to get more detailed instruction of.

Because this example is a permission system for developing OAs, add more people who want to hide unauthorized classification and files. GetfatherMenuid () in the Perm function is a more important ring. I think a long time, because the first time, I don't know how efficiency, I hope everyone test. It is mainly obtained by this method to obtain the corresponding permissions, in this method, there is no classification of permissions, and then get the list of files with permissions and permissions from getmemberMallList (). You can comment on this program. .

Another focus is the check () class in the checkpriv.calss.php file, which determines if there is direct access to this page. The working principle is as follows: 1. First get the privilege ID required by the current file. Add the checkfileperm () method to the checkfileperm () method in the corresponding page. For example, how to get it, please study or ask yourself.

All the functions used in this example can be found in includees / functionin.php, which is a function set. The reason why this is because even the first time to write such permission classes, it used to use others, and it is also a contribution to the village. It is too much from the things you have obtained from the village. Also, I have agreed to QQ group PHP Family (31 :: 838) leisure and other people asked to write a directory allocation in the PHP application project. In fact, this catalog distribution is not reasonable enough, but for the general application of corporate websites. enough. There is a chance to develop OA's catalog architecture solution for everyone to discuss. Thank you. Install, the new database PERM import file perm.sql. Configure configs.inc.php to work with the program. Note Set the website physical path Define ("rootpath", "x: / xxxxx");

Because the time is not written, it declares a $ _SESSION ['User'] ['UID'] in Index.php; if you use this program, please follow the principle of this program or Change perm.class.php file () method: $ this-> MID = $ _SESSION ['User'] ['uid'] is $ this-> mid = you set session method, such as $ _SESSION [ 'userid'];

Yes, there is another point that this instance contains the configuration operations of AdoDB and Smarty, and everyone's discussion is more discussed. Beginners can learn about it. I don't dare to say it is great, but I have been using so that I feel very cool.

Download link http://phpx.com/happy/attachment.php?s=&postid=694646 // is made using smart and adoDB, recommended download

转载请注明原文地址:https://www.9cbs.com/read-60473.html

New Post(0)