The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
changing and adding a redirect path - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: changing and adding a redirect path (/showthread.php?tid=481)

Pages: 1 2 3


changing and adding a redirect path - raven - 02-27-2017

i like how the security redirects but i would like to change its path as well as add a few for other user classes eg users stay where there at but, managers would direct to a account page with aditional things on it like access buttons to other parts of the system with out them being visable to non manaagers

where is that located and how would i add classes to it for redirect


changing and adding a redirect path - mudmin - 02-27-2017

The redirects are in the securePage function in us_helpers, which is a core system file so changes you make there could be overwritten with updates.

What would you like to see happen? I might be able to give you a different way to accomplish it


changing and adding a redirect path - raven - 02-27-2017

in practice i would like to see the error redirect to anything with a classic saying of this page is restricted etc admins have been alerted just the generic stop poking around threat. also it would be nice to user classed redirects eg regular users of permission level user redirect as normal. but users of permission level moderator redirect to the not created moderator account page that would have additional buttons and menus for the other functions that they have permission to i would like to see the main admin permission class redirect straight to the admin page... i just figured something out though with out the ability to set inheritance of permissions my per user class redirect wont work right i don't think. because as it is now say a moderator for example would have the permissions moderator and user where it should be set as moderator only because the permission moderator inherits all the perms from user and then some make sense.

i am pulling the inheritance reference from a java scrips plugin for mine craft called permessions ex or PEX for short https://dev.bukkit.org/projects/permissionsex

http://pastebin.com/m4ippcjn
this is my permissions file that i use on my server notice how each "rank" from default to owner has its inheritance

default is the lowest class player anyone who plays is auto added to this rank. then it splits from there it goes like so

donor1 inherits from default all the perms that they have plus the perms that donor1 has listed

donor2 inherits from donor1 but one command is removed and other commands are added

donor 3 inherits from donor 2 commands are removed others added

etc all the way to donor 5

the staff ranks follow the same pattern

helper inherits all default commands

mod inherits all helper commands

admin inherits from mod

headadmin inherits from admin

owner inherits from headadmin

but the catch is with the diferent rank ladders the staff are allowed to hold 2 ranks a donor rank and a staff rank but thats not what im after here just the inheritance for redirects or the ability to redirect different permission levels in side userspice

make sense


changing and adding a redirect path - mudmin - 02-27-2017

I am about to push out an update with 2 scripts in usersc/scripts

In one, you can do whatever you want for someone who was not logged in (including redirect them to somewhere else) and the other you can do whatever you want for someone who failed the permission check.


changing and adding a redirect path - mudmin - 02-27-2017

Here you go... let me know what you think...
https://userspice.com/patch/421dto421f.zip


changing and adding a redirect path - raven - 02-28-2017

this looks promising but how would i reference the user class eg moderator to direct to a moderator account page same as a user account page with the addition of said buttons and menu options


changing and adding a redirect path - raven - 02-28-2017

this is as close as i can explain what i want this is a sample of a still bugged if condition is this do this else do that

void loop() {
// put your main code here, to run repeatedly:
// ac high low
if (dcu1 == HIGH) {
if (hipressw == HIGH){
if(fan == LOW){

digitalWrite(evplow, HIGH);
delay(50);
digitalWrite(condfan, HIGH);
delay(50);
digitalWrite(accomp, HIGH);
}
else{
digitalWrite(evplow, HIGH);
delay(100);
digitalWrite(evphigh, HIGH);
delay(50);
digitalWrite(condfan, HIGH);
delay(50);
digitalWrite(accomp, HIGH);
}
}
else{
digitalWrite(accomp, LOW);
delay(50);
digitalWrite(evplow, HIGH);
delay(100);
digitalWrite(evphigh, HIGH);
delay(50);
digitalWrite(condfan, HIGH);
}
}



thats more or less what im after for the user redirects if user data permission is 1 it redirects normally
but if user data permission is 2 it redricts differently

same with any permission level that i would change else it just redirects normally


changing and adding a redirect path - dan - 02-28-2017

What about taking a look at the checkMenu (single) and hasPerm (array) functions in users/helpers/us-helpers... You could copy one or both of them to usersc/includes/custom_functions, rename them, and use them as the basis for your permission based redirect.


changing and adding a redirect path - raven - 02-28-2017

hmm tbh im not at all familar with php in the least now yaml config i can do as well as some c++ for micro controllers and i dabble with html i know enough to eventually get what i want lol


changing and adding a redirect path - mudmin - 02-28-2017

So if your permission levels in are in userspice, you can go into the admin panel and at the top click on permission levels. Each permission level has an id. 1 is regular user. 2 is admin. The others you just add on your own. So in that usersc/scripts/did_not_have_permission.php you can put...

if(hasPerm([1],$user->data->id()){
Redirect::to('here');
}

if(hasPerm([2],$user->data->id()){
Redirect::to('here');
}

You can also put them in as an array, so
if(hasPerm([3,4,5],$user->data->id()){
Redirect::to('here');
}

Finally, you can redirect them with a message
if(hasPerm([2],$user->data->id()){
Redirect::to('account.php?err=Sorry+you+do+not+have+permission!');
}