Where can I find in Joomla 1.5 file system that file where in jos_core_acl_aro
and jos_core_acl_groups_aro_map table the values are inserted after registration ? Or some documentation for it.
I have a custom table with users(not jos_users). I want to display the user menu after login.
I think that the ACL system is querying the users from jos_users. I want to query them from my custom table and also insert my users values in those two acl tables.
There are only two relevant files, where the ACL maps are touched.
administrator/components/com_users/views/users/view.html.php (UsersViewUsers)
libraries/joomla/user/authorization.php (JAuthorization)
The JAuthorisation class uses the GACL library in libraries/joomla/phpgacl/, which you can use to learn about the interna, but should only be used through JAuthorisation.
Related
I'm developing the CMS(College Management System) website using LARAVEL PHP framework. Now we need to build up to three types of consoles(Admin, Student, Employee). I'm stuck in the admin console that admin is able to perform the selections process. I have performed the task for the following.
Foreach series has many Users.
Foreach users have one Profile.
Foreach profile has many qualifications, experiences, attendances..
Students and Employees Record saved in the user's table.
Now we need to remove students and employees written in the eclipse shape because there is a duplication code in these two tables(student and employee), then we need to create the profiles table. Now remaining tables classes and courses(I have not yet decided what type of relation).
If you need any code from this example then I will add in the comments section.
In order to prevent duplication (if students and employees will always be the same entity) is to introduce a new model in the system called Person (or something similar). Then you will create additionally a PersonType enabling you to expand the model further if you ever need something more than student and employee.
DB schema would then have a relationship:
persons ---- M:1 ---- person_types
Where person_types would have:
ID Name
1 Student
2 Employee
This way you can reuse everything.
I am working on creating a web-based grade sheet using mysql and php. An admin create column dynamically using jquery item names can be entered such as project1, mid-term etc. I want to create a table based on the admin selection. Example, if admin adds three items(assignment1, assignment2, final exam), a table gets created with column (assignment1, assignment2, final exam).
Write a PHP application that receives the submitted form and based on the selection, generates a CREATE TABLE statement and sends it to the MySQL server. You have examples of this statement here: https://dev.mysql.com/doc/refman/5.7/en/create-table.html
I want to design a DB which will be connected to PHP Application. In the app there are two types of users: company and person. Some functionality like adding articles will be done by both so in other tables there are author_id columns. So firstly I decided to create user column.
That's easy: id, username, password, role, active, created where role defines whether user is person or company.
Now I want to add profile table or profile tables depends on what you'd suggest (joined with the previous table by adding profile_id column there).
Both roles have different fields, which are required during registration.
The easiest thing would be to create one table with all required fields for both roles, allow them NULL values and in the PHP app (made in Yii Framework in this case) define requirements for each role in models.
The nicest thing would be to create separate tables for both roles BUT the questions is how to connect these two tables to one table using Foreign Key? Is it even possible. I know I may omit foreign key creation then based on role choose table, and from that table choose profile_id.
Or maybe you have another solution to my problem.
Thanks in advance for replies.
Adrian
You need an intermediary between the page and the database to assign the user to a group that has specific privileges. It's usually accomplished with a user-group-role design.
You can have a table for users system info (username , pass ...), and another for users profile (firstname , birthday ...), and another for groups(superuser , ...).
where user table can have multiple groups: user:one->group:many
user can have one profile user:one->profile:one
I think this is a decent solution.
I have a site which allows users to make changes to content. How can I implement a rollback system? I'm using php and mysql, I was thinking of creating tables such as the following:
posts table --- posts_rollback table --- rollback table
The posts_rollback table would act as a lookup table. The posts table has a one to many relationship with the posts_rollback table. I would then use inner_join to
Is there a better way of doing this or any class/feature which automatically does this itself?
I think what you mean is content versioning (like here on SO) rather than rollbacks - the term "rollback" is mostly used in context of database transactions.
The simplest thing that comes to mind is to have two tables: posts that stores non-editable data (author, date created) and content with versioned data (text, date-updated, editor etc). Have a field called "version" in the posts table. When a post is updated, increase "version" and insert the data into content, along with post ID and "version". When retrieving posts, join content with posts on posts.id and posts.version.
I'm building a website that constructs both site-wide and user-specific activity feeds. I hope that you can see the structure below and share you insight as to whether my solution is doing the job. This is complicated by the fact that I have multiple types of users that right now are not stored in one master table. This is because the types of users are quite different and constructing multiple different tables for user meta-data would I think be too much trouble. In addition, there are multiple types of content that can be acted upon, and multiple types of activity (following, submitting, commenting, etc.).
Constructing a site-wide activity feed is simple because everything is logged to the main feed table and I just build out a list. I have a master feed table in MySQL that simple logs:
type of activity;
type of target entity;
id of target entity;
type of source entity (i.e., user or organization);
id of source entity.
(This is just a big reference table that points the script generating the feed to the appropriate table(s) for each feed entry).
In generating the user-specific feed, I'm trying to figure out some way to join the relationship table with the feed table, and using that to parse results. I have a relationships table, comprised of 'following' relationships, that is similar to the feed table. It is simpler though b/c only one type of user is allowed to follow other content types/users.
user/source id;
type of target entity;
id of target entity.
Columns 2 & 3 in the feed and follow table are the same, and I have been trying to use various JOIN methodologies to match them up, and then limit them by any relationships in the follow table that the user has. This is has not been very successful.
The basic query I am using is:
SELECT *
FROM (`feed` as fe) LEFT OUTER JOIN `follow` as fo
ON `fe`.`feed_target_type` = `fo`.`follow_e_type`
AND fo.follow_e_id = fe.feed_target_id
WHERE `fo`.`follow_u_id` = 1 OR fe.feed_e_id = 1
AND fe.feed_e_type = 'user'
ORDER BY `fe`.`feed_timestamp` desc LIMIT 10
This query also attempts to grab any content that the user has created (which data is logged in the feed table) that the user is, in effect, following by default.
This query seems to work, but it took me sometime to get to it and am pretty sure I'm missing a more elegant solution. Any ideas?
The first site I made with an activity feed had a notifications table where activities were logged, and then friends actions were pulled from that. However a few months down the line this hit millions of records.
The solution I am programming now pulls latest "friends" activities from separate tables and then orders by date. The query is at home, can post the example later if interested?