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
/portal.php 39 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 1,007
» Latest member: kavitasinghji
» Forum threads: 1,324
» Forum posts: 7,788

Full Statistics

Online Users
There are currently 392 online users.
» 0 Member(s) | 390 Guest(s)
Bing, Google

Latest Threads
UserSpice Alpha Testing a...
Forum: News Center
Last Post: ivinsons
11-08-2024, 06:13 PM
» Replies: 13
» Views: 42,475
UserSpice 4.4 Development
Forum: News Center
Last Post: Amelie12
09-21-2024, 12:23 PM
» Replies: 4
» Views: 15,199
Welcome to the new UserSp...
Forum: News Center
Last Post: ivinsons
08-25-2024, 07:39 AM
» Replies: 2
» Views: 27,918
How to use hasPerm
Forum: UserSpice 4.4
Last Post: mudmin
07-20-2019, 02:45 PM
» Replies: 1
» Views: 13,755
Session issue? What I sho...
Forum: UserSpice 4.4
Last Post: Parth
07-17-2019, 05:06 PM
» Replies: 4
» Views: 14,502
Email Error
Forum: UserSpice 4.4
Last Post: Brandin
07-17-2019, 04:47 PM
» Replies: 1
» Views: 6,623
{ Missing Text } after up...
Forum: UserSpice 4.4
Last Post: Brandin
07-16-2019, 04:23 PM
» Replies: 22
» Views: 53,638
Best Practice Info
Forum: New to UserSpice?
Last Post: Brandin
07-16-2019, 11:55 AM
» Replies: 1
» Views: 13,490
Force to use 2FA -always-
Forum: UserSpice 4.4
Last Post: Brandin
07-12-2019, 12:43 PM
» Replies: 1
» Views: 6,636
e-mail not verifying
Forum: UserSpice 4.4
Last Post: LBC
07-10-2019, 11:34 AM
» Replies: 31
» Views: 76,232

 
  loading pages through route
Posted by: marceloatmartins - 06-26-2017, 10:59 AM - Forum: UserSpice 4.3 and Below - No Replies

Hi Everybody

Are there some resources in US for loading pages through route ?
Or can I use something like Slim.php together with US ?

Thanks for all


  Restrict per-user download
Posted by: amilan - 06-25-2017, 10:16 PM - Forum: UserSpice 4.3 and Below - No Replies

Hi,

what is the easiest way using UserSpice to let each user download a specific file only after they have signed in. The link to the file should also not be valid if copied and pasted by a different users.

Cheers
Anton


  Multiple Forms
Posted by: Brandin - 06-25-2017, 12:54 PM - Forum: Off-topic Discussions - Replies (13)

Hello,

I have multiple pages where I have several forms, all of which I have the token CSRF token obviously as this is the best practice - however, how do I go about ensuring all forms have the token on submit so the post doesn't die if one of the forms generates a different token?

Sorry if my description doesn't make sense, but I am sure you will understand.

Thanks!


  checkMenu Page
Posted by: Brandin - 06-24-2017, 12:57 PM - Forum: Off-topic Discussions - Replies (2)

Hello!

I want to use a menu link, and instead of hard coding the permission levels that have access to that menu link, check the file and see if that permission level is in the users? Can this be coded into a function so I don't have to write the code out everytime and just call the function with the file name I want to check?

Thank you!


  session variable
Posted by: marceloatmartins - 06-23-2017, 05:13 PM - Forum: UserSpice 4.3 and Below - Replies (1)

Hi everybody,
Sorry for my basic doubt, lol.
How can I set session variable using UserSpice resources?

I need to store an array (data form table) with options like session variable for avoid disk access. Is possible ?

Thanks


  Class Bloat
Posted by: faguss - 06-22-2017, 06:00 PM - Forum: UserSpice 4.3 and Below - Replies (2)

Why is there a class for accessing one global variable? It's faster and simpler to just use:

Code:
$GLOBALS['config']['mysql']['username']

Similar case with Cookie, Hash, Input, Redirect, Session and Token. They could just be functions instead of static methods.


  us_helpers.php undefined varible
Posted by: jdmfarms - 06-20-2017, 04:24 PM - Forum: UserSpice 4.3 and Below - Replies (43)

Hello.

I am getting an error log from the subject php file.

$row at line 169 is not defined. It is part of a function.

function getPathPhpFiles($absRoot,$urlRoot,$fullPath) {
$directory = $absRoot.$urlRoot.$fullPath;
//bold ($directory);
$pages = glob($directory . "*.php");

foreach ($pages as $page){
$fixed = str_replace($absRoot.$urlRoot,'',$page);
$row[$fixed] = $fixed;
}
return $row;


Should I change this to page?

thanks.


  Protect HTML files
Posted by: truemama - 06-20-2017, 02:06 PM - Forum: Off-topic Discussions - Replies (7)

Hi, I've configured my server via htaccess to process .html in the same way as .php and want to ptotcet those files in same way, the current access pages doesn't pick up the HTML extension....in user cake I was able to change which file types were automatically picked up but can't find that in the code....could anyone please point me to where in user spice it pulls in the permissionable files?

Thanks in advance!


  Validation Class Improvements
Posted by: faguss - 06-20-2017, 01:18 PM - Forum: Modifications and Hackery - Replies (11)

Somehow my topic disappeared while I was editing so I'm reposting it.

https://pastebin.com/KmhvbPFh

46,51 - Replaced empty() with strlen()==0 because if the input was "0" (number zero) then the validation wouldn't work.



78-87 - Optionally you can pass array to the unique for a more complicated query (provided you have this patch). For example:

Code:
"unique"=>["tablename", ["and", ["SomeData","=",1], ["OtherData","=",2]]]
Also it will fail validation if query returned an error (which the original did not do).


110-147 - Added rules <, >, <=, >=, !=, == for comparing numbers. They will automatically check if value is a number so there's no need to stack it with is_numeric. For example:
Code:
">="=>25
(equal to 25 or greater ). You can also compare it against other fields. For example:
Code:
">"=>"Price"
(greater than the number in the "Price" input)


149-152 - Added rule is_int for excluding floats.
Code:
"is_int"=>true


209-210 - In function addError() added condition to prevent error message duplication.

===

EDIT:

54-55, 62-63, 70-73 - One issue with using array keys as rules is that you can't stack them. I've added an option to pass an array to rules: min, max, matches, <, >, <=, >=, !=, ==. For example:
Code:
">"=>[25,"Price"]

154-158 - Added rule is_timezone for verifying time zone name.
Code:
"is_timezone"=>true

100, 149 - Added
Code:
is_num
(synonymous with
Code:
is_numeric
). Added
Code:
is_integer
(synonymous with
Code:
is_int
)

160-189 - Added rule in for matching string lowercase.
Code:
"in"=>["a","b","c"]

30, 38-41 - If value is an array then
Code:
sanitize
will return an error. Because I use
Code:
Input::get
I don't want to sanitize again so I added optional argument to skip it

43-44, 51, 57, 65 - My earlier change to
Code:
strlen
screwed me over because values couldn't be arrays. Added condition to detect value type.

46-49 - Rule
Code:
required
now needs to be set to
Code:
true
in order to work

160-189 - Value for the rule
Code:
in
can now be array. Optionally containing sub-arrays where
Code:
[["display","value"]]

22, 2333 - In my view
Code:
_passed
is an unnecessary state so I've removed it. Better to just check if
Code:
_errors
isn't empty which I can do directly now because it's public.

191-198 - added rule is_datetime following this method. Example:
Code:
"is_datetime"=>"Y-m-d"


  database concurrency
Posted by: marceloatmartins - 06-20-2017, 11:36 AM - Forum: UserSpice 4.3 and Below - Replies (2)

Hi Dan,
Thinking in a multi-user environment is possible create some mechanism for when I do update any line of my database, I can re-read the line of my database, before my update, and see if had changes any data since my last read?

Something like a incremental column that always that happening some update this value will be incremented. And then always before any update the system will read again and compare this control (incremental column) with my last control before update and if they are different then I know that had any changes and I abort my operation. Do you understood?

Sorry for my english, because I think in Portuguese when I write in English, really sorry.

Hugs