A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. if(!defined('entry'))define('entry', true);
  3. /* ===========================
  4. gelato CMS - A PHP based tumblelog CMS
  5. development version
  6. http://www.gelatocms.com/
  7. gelato CMS is a free software licensed under the GPL 2.0
  8. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  9. =========================== */
  10. ?>
  11. <?php
  12. require_once('../entry.php');
  13. global $user;
  14. if ($user->isAdmin()) {
  15. if ($_GET["action"]) {
  16. if ($_GET["action"] == "close") {
  17. session_start();
  18. if ($user->closeSession()) {
  19. echo __("&nbsp;ending session&hellip;");
  20. } else {
  21. echo __("&nbsp;failure ending session&hellip;");
  22. }
  23. } // $_GET["action"] == "close"
  24. if ($_GET["action"] == "verify") {
  25. if ($_GET["login"]=="") {
  26. echo "<div class=\"error\">".__("Required field cannot be left blank.")."</div>";
  27. } else {
  28. if (!$user->userExist($_GET["login"])) {
  29. echo "<div class=\"exito\">".__("Username available.")."</div>";
  30. } else {
  31. echo "<div class=\"error\">".__("The username is not available.")."</div>";
  32. }
  33. }
  34. } // $_GET["action"] == "verify"
  35. } // $_GET["action"]
  36. } // $user->isAdmin()
  37. ?>