Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

add_user_role.php 459B

12345678910111213141516171819202122232425262728
  1. <?php
  2. require_once('../includes/config.php');
  3. if(isset($_POST))
  4. {
  5. if ($logged_in)
  6. {
  7. $user_id = rawurldecode($_POST['id']);
  8. $role_name = rawurldecode($_POST['role']);
  9. $role = Role::getRole($db, $role_name);
  10. if ($role)
  11. {
  12. $userTools->insertUserRoles($user_id, array($role['role_id']));
  13. }
  14. else
  15. {
  16. echo "Invalid Role";
  17. }
  18. }
  19. else
  20. {
  21. echo "You need to be logged in";
  22. }
  23. }
  24. else
  25. {
  26. echo "POST not set";
  27. }
  28. ?>