PageRenderTime 33ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/public/codeCore/php/secure/adminAddLink.php

https://github.com/IAmCorbin/MooKit
PHP | 21 lines | 14 code | 0 blank | 7 comment | 1 complexity | 4d918623affd0cac8430be9cb0e6b800 MD5 | raw file
Possible License(s): GPL-3.0
  1. <?
  2. /**
  3. * Administrator - Add a new Link
  4. * @package MooKit
  5. */
  6. //require Administrator Access
  7. if(Security::clearance() & ACCESS_ADMIN) {
  8. $link = new Link(array('name'=>$_POST['name'],
  9. 'href'=>$_POST['href'],
  10. 'desc'=>$_POST['desc'],
  11. 'weight'=>$_POST['weight'],
  12. 'ajaxLink'=>$_POST['ajaxLink'],
  13. 'menuLink'=>$_POST['menuLink'],
  14. 'access_level'=>$_POST['access_level']));
  15. //attempt to add it to the database
  16. $link->insert();
  17. //return results
  18. echo $link->json_status;
  19. } else
  20. echo "Unauthorized";
  21. ?>