The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 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!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connect to another database and edit the rows as admin
#1
I have a table called "invoices" and as an admin I want to be able to edit the users invoices, I've tried repurposing the 'admin_user.php' but it keeps returning a 500 error. Please help.
  Reply
#2
So there are a few ways to do this, but what you are mainly going to want to do is to wrap the whole edit function in a hasPerm function.

Let's say your table is being created. So in my situation, I only wanted someone with the permission level of admin OR purchaser to be able to see purchase requests that had been closed.

Code:
<?php if(hasPerm([2,103],$user->data()->id)){ ?>
Code:
<div class="col-sm-3">
Code:
<a class="btn" href="purchaser_all_pr.php?closed=3">Show CLOSED UNRECORDED PRs</a><br>
Code:
</div>

Code:
<?php } ?>

You would do the same thing for your edit button, and it wouldn't show up for anyone who didn't have the permission level of 2(admin)
  Reply
#3
ok thank you very much
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)