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('../config.php');
  13. include("../classes/user.class.php");
  14. $user = new user();
  15. if ($user->isAdmin()) {
  16. if ($_GET["action"]) {
  17. if ($_GET["action"] == "close") {
  18. session_start();
  19. if ($user->closeSession()) {
  20. echo __("&nbsp;ending session...");
  21. } else {
  22. echo __("&nbsp;failure ending session...");
  23. }
  24. } // $_GET["action"] == "close"
  25. if ($_GET["action"] == "verify") {
  26. if ($_GET["login"]=="") {
  27. echo "<div class=\"error\">".__("Required field cannot be left blank.")."</div>";
  28. } else {
  29. if (!$user->userExist($_GET["login"])) {
  30. echo "<div class=\"exito\">".__("Username available.")."</div>";
  31. } else {
  32. echo "<div class=\"error\">".__("The username is not available.")."</div>";
  33. }
  34. }
  35. } // $_GET["action"] == "verify"
  36. } // $_GET["action"]
  37. } // $user->isAdmin()
  38. ?>