Advertisement
Guest User

Untitled

a guest
Apr 19th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1.  
  2. require_once 'sign_up.php';
  3. function callback_func($admin) {
  4.     require_once ($_SERVER['DOCUMENT_ROOT'] . '/settings/index.php');
  5. }
  6.  
  7. spl_autoload_register('callback_func');
  8.  
  9. $all_users = unserialize(file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/settings/all_users.php'));
  10.  
  11. class pageOwner {
  12. static $instance;
  13. static $username = $GLOBALS['username'];
  14.  
  15. static function assignStatic() {
  16. if (is_null(self::$instance)) {
  17. foreach($GLOBALS['all_users'] as $user) { /* this loop should check where the array for where the new object matches, fetch that object then store it in the instance static variable */
  18. if ($user->username == $username) {
  19.  
  20. return self::$instance = $user;
  21.  
  22. }
  23.  
  24. }
  25. }
  26. }
  27. }
  28. pageOwner::assignStatic();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement