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 470 online users.
» 0 Member(s) | 468 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

 
  mssql connection
Posted by: sqluser - 09-06-2016, 06:56 AM - Forum: UserSpice 5 - Roadmapping the Future - Replies (1)

Working great on mysql but now there is the need to build a website on a complete windows system. Windows server with PHP7 and MSSQL server.
Is there a posibility to change the DB connection from mysql into mssql.
mysqli_connect -> sqlsrv_connect, but since this the database connection is complete intergrated and difficult for a user to port to a new database.
It is not a great usergroup that uses PHP and MSSQL, but it would be nice if it would be possible with your tool.
Until my status of today this is the best package for management and usercontrol with greater users and different groups.
Waiting for your positive feedback and upgrade.


  MSSQL and userspice
Posted by: sqluser - 09-06-2016, 06:43 AM - Forum: New to UserSpice? - Replies (6)

Hi,
transfer the websire to a new windows system, with php7 and Microsoft SQL server.
Is there already a configuration for UserSpice41 that can be used on this enviroment.
mysqli_connect must be changed into sqlsrv_connect.

Could you make it transparant for the database version.
We like your functionality for management and user, usergroups control.


  MVC-lite structure
Posted by: plb - 09-06-2016, 03:56 AM - Forum: Off-topic Discussions - Replies (1)

I am in a situation where I have the same data which must be presented in various different ways.

Has there been discussion about the best way to structure US so as to implement a lite version of MVC or at least separating the "view" from the "data collection"?

Basically I want the same SQL queries to be used for 2 different views. I could implement the 2 different views in a single script with a lot of complicated and hard-to-read conditionals or I could "require" the query stuff from a separate script but both seem forced and awkward...


  Suggested new function in US_helpers.php
Posted by: plb - 09-04-2016, 02:13 PM - Forum: Modifications and Hackery - Replies (1)

The current definition of

Code:
checkPermissions()
is somewhat special-purpose and (perhaps) obsolete.

I am suggesting a new function called
Code:
hasPermission()
which is a little more general-purpose and will change the definition of
Code:
checkPermissions()
to simply call
Code:
hasPermission()
with the appropriate parameter.

I will confess I am happy with the stability of
Code:
hasPermission()
(I have tested it) whereas I don't use
Code:
checkPermissions()
at all and so I haven't tested whether my change is backward compatible. [honesty strikes] OK, I haven't tested my definition of
Code:
checkPermission()
at all - I just typed it into the pastebin. Phew, conscience relieved. :-)

http://pastebin.com/cexD5maq

This provides a more generic way to check if a user (either the current user or someone else) has a given permission/group.


  admin_user delete bug
Posted by: plb - 09-04-2016, 01:58 PM - Forum: UserSpice 4.3 and Below - Replies (5)

When I go to users/admin_user.php and mark a user to delete, I get an error message that $validate variable doesn't exist.

I have patched the code - here's a copy on pastebin:

http://pastebin.com/YQzNN58E

While I was in there I fixed some indentation issues just for presentation of the code - makes it more readable and standard with the rest of US.

(I'd like to put a little border around the "create new user" section, but I'm still working on what CSS from bootstrap looks best there - there may be a second version in a bit...)


  verify.php bug and possible solution.
Posted by: anphung - 09-03-2016, 03:52 PM - Forum: UserSpice 4.3 and Below - Replies (14)

Hi, I would like to say a big thank you for such a wonderful project! Very nicely thought out and saves me months if not weeks of work.
I've installed the latest version 4.1.4b and initial testing worked extremely well.
However when I changed the admin email address, the system breaks down and sends me to a not found page with the
message:
The requested URL /userManagement/users/users/verify.php was not found on this server.
(where userManagement is the userSpice installation.)

I can't even log in!

I searched the forum and notice others are having similar (if not the same) problem.

Anyway, after much digging around, I found the bug in the verify.php:

verify.php
if($user->isLoggedIn()){
$user->logout();
Redirect::to('users/verify.php');
}

Simply change it to:

if($user->isLoggedIn()){
$user->logout();
Redirect::to('verify.php');
}

and you should be good to go. Note that if error still exist, close browser and log in again.
Not sure if this is the proper fix, please advice.


  Is function checkPermission($permission) valid to use?
Posted by: plb - 09-01-2016, 04:42 PM - Forum: Off-topic Discussions - Replies (5)

I was getting ready to write a function to check if the current user had a given permission level and I came across this function on line 419 of us_helpers.php:

Code:
//Does user have permission
Code:
//This is the old school UserSpice Permission System
Code:
function checkPermission($permission) {

Does this "old school" mean I shouldn't be using it?

Is there an explanation anywhere about the whole permissions system without going through the video as it is coded? I want to treat "permissions" as the concept of groups from linux, but i'm not sure if I'm OK going that route or not...


  If Config::get() doesn't match it should return false
Posted by: plb - 09-01-2016, 03:40 PM - Forum: UserSpice 4.3 and Below - Replies (3)

Please see this paste:

http://pastebin.com/hXtASj6S

If the value is not found in Config then we shouldn't get back the whole $_GLOBALS['config'] - instead we should get a false return value so we can handle that and provide an appropriate default.


  Bad install on iis express
Posted by: aeh - 08-29-2016, 12:53 PM - Forum: UserSpice 4.3 and Below - Replies (1)

Userspice 4.1
I'm doing local development using IIS7 Express. Installs fine using XAMPP, but I get the following error with IIS Express:
PHP Parse error: syntax error, unexpected end of file, expecting ‘)’ in \users\init.php on line 26
I have made sure users/init.php is writable.
Thanks!


  DB.php patch - error handling, flexible WHERE clauses, fix bug
Posted by: plb - 08-28-2016, 02:01 PM - Forum: Modifications and Hackery - Replies (14)

Here's a patch:

http://pastebin.com/0rhnxLB7

This allows someone to add Config::get('mysql/options') and control the options used for the PDO driver.

Specifically I have set mine to this:


Code:
$GLOBALS['config'] = array(
Code:
'mysql' => array('host'         => 'localhost',
Code:
'username'     => 'root',
Code:
'password'     => '(secret)',
Code:
'db'           => 'imok',
Code:
'options'      => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET SESSION sql_mode = ''",
Code:
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING),
Code:
),

(Sorry, I can't figure out how to make code blocks work in multiple lines... The forum always seems to strip the newlines when I mark it as code.)

This PDO::ERRMODE_WARNING makes the database respond with an exception when it has an error - otherwise the default case is to just keep on going and don't say anything. I, personally, find this pretty important in my development environment to avoid errors that might otherwise go completely unnoticed.

Setting this ERRMODE_WARNING allowed me to see the bug in DB.php where a fetchALL() was being done even if the query was an INSERT or UPDATE or DELETE. This bug is now fixed in this patch.

Finally, the WHERE clauses on the get() and delete() functions were quite limited, allowing a maximum of a single condition unless you wanted to construct your own query. This patch includes a recursive build of the WHERE clause which allows nested arrays and the use of 'AND' and 'OR' and does the same for the existing triad-type of arrays as well as the duple-type of arrays that people from CakePHP might be more familiar with. Importantly, it is completely backward compatible and so anybody who has used the existing functionality will not have to change anything.

One could argue that simply writing your own query for anything more complicated than a single condition is more readable. I wouldn't argue. This gives more flexibility for those who may prefer the array-type of WHERE-clause construction.

For example, these would all work now:

Using current triads to construct the conditions:
$db->get('users', [ 'id', '=', '2' ]); // backwards compatible
$db->get('users', [ 'and', [ 'id', '=', '2' ], ['fname', '=', 'Sam' ]]) // WHERE id = 2 AND fname = 'Sam'
$db->get('users', [ 'or', [ 'fname', '=', 'Sally' ], ['fname', '=', 'Sam' ]]) // WHERE fname = 'Sally' OR fname = 'Sam'

Using CakePHP style dupals to make the same conditions:
$db->get('users', [ 'id' => '2' ]); // WHERE id = 2
$db->get('users', [ 'and' => [ 'id' => '2', 'fname' => 'Sam' ]]) // WHERE id = 2 AND fname = 'Sam'
$db->get('users', [ 'or' => [ 'fname' => 'Sally', 'fname =' => 'Sam' ]]) // WHERE fname = 'Sally' OR fname = 'Sam'

Note the need to have unique keys in the dupal style - I had to use 'fname' for one and 'fname =' in the other. I can't remember how you're supposed to solve this in Cake. Maybe just nesting?

Do be aware that I've done some relatively surface level testing on this recursive WHERE construction, but I haven't done any deep construction. Let me know if you come across bugs and I'll try to fix it.