-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New funclionality to Clone user with permissions and categories #29773
base: develop
Are you sure you want to change the base?
Conversation
htdocs/user/class/user.class.php
Outdated
$sql .= " SELECT 1"; | ||
$sql .= " FROM ".$this->db->prefix()."user_rights dest"; | ||
$sql .= " WHERE dest.entity = src.entity"; | ||
$sql .= " AND dest.fk_user = ".$this->db->escape($toId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an int so must use
$sql .= " AND dest.fk_user = ".((int) $toId);
htdocs/user/class/user.class.php
Outdated
|
||
// Construction de la requête d'insertion | ||
$sql = "INSERT INTO ".$this->db->prefix()."user_rights (entity, fk_user, fk_id)"; | ||
$sql .= " SELECT entity, ".$this->db->escape($toId).", fk_id"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an int so must use
$sql .= " SELECT entity, ".((int) $toId).", fk_id";
htdocs/user/class/user.class.php
Outdated
$categorystatic = new Categorie($this->db); | ||
|
||
$sql = "INSERT INTO ".$this->db->prefix()."categorie_".(empty($categorystatic->MAP_CAT_TABLE[$type]) ? $type : $categorystatic->MAP_CAT_TABLE[$type])." (fk_categorie, fk_user)"; | ||
$sql .= " SELECT fk_categorie, $toId FROM ".$this->db->prefix()."categorie_".(empty($categorystatic->MAP_CAT_TABLE[$type]) ? $type : $categorystatic->MAP_CAT_TABLE[$type]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$toId must be sanitized with (int)
NEW|New functionality to clone user