Advertisement
Guest User

Untitled

a guest
Jun 4th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. <?php
  2. include 'init.php';
  3. include $apps_path['libs'].'/function.php';
  4.  
  5. if (function_exists('bindtextdomain')) {
  6. bindtextdomain('messages', $apps_path['themes'].'/'.$themes_module.'/language/');
  7. }
  8.  
  9. // fixme anton
  10. // load app extensions from index, such as menu, webservices and callbacks
  11. // using $app you can do up to load another application from playSMS if you need to
  12. // but the point is to make a single gate into playSMS, that is through index.php
  13. $app = $_REQUEST['app'];
  14. if (isset($app)) {
  15. switch ($app) {
  16. case 'mn':
  17. case 'menu':
  18. // $app=menu to access menus, replacement of direct access to menu.php
  19. $fn = $apps_path['incs'].'/app/menu.php';
  20. if (file_exists($fn)) {
  21. include $fn;
  22. }
  23. break;
  24. case 'ws':
  25. case 'webservice':
  26. case 'webservices':
  27. // $app=webservices to access webservices, replacement of input.php and output.php
  28. $fn = $apps_path['incs'].'/app/webservices.php';
  29. if (file_exists($fn)) {
  30. include $fn;
  31. }
  32. break;
  33. case 'call':
  34. // $app=call to access subroutine in a plugin
  35. // can be used to replace callback.php in clickatell or dlr.php and geturl.php in kannel
  36. // plugin's category such as feature, tools or gateway
  37. $cat = trim($_REQUEST['cat']);
  38. // plugin's name such as kannel, sms_board or sms_subscribe
  39. $plugin = trim($_REQUEST['plugin']);
  40. if (function_exists('bindtextdomain')) {
  41. bindtextdomain('messages', $apps_path['plug'].'/'.$cat.'/'.$plugin.'/language/');
  42. }
  43. x_hook($plugin,'call',array($_REQUEST));
  44. break;
  45. case 'page':
  46. // $app=page to access a page inside themes
  47. // by default this is used for displaying 'forgot password' page and 'register an account' page
  48. // login, logout, register, forgot password, noaccess
  49. switch ($op) {
  50. case 'auth_login':
  51. case 'auth_logout':
  52. case 'auth_forgot':
  53. case 'auth_register':
  54. if (function_exists($op)) {
  55. call_user_func($op);
  56. }
  57. break;
  58. default:
  59. // error messages
  60. $error_content = '';
  61. if ($errid) {
  62. $err = logger_get_error_string($errid);
  63. }
  64. if ($err) {
  65. $error_content = "<div class=error_string>$err</div>";
  66. }
  67. // load page
  68. $fn = $core_config['apps_path']['themes'].'/'.$core_config['module']['themes'].'/page_'.$inc.'.php';
  69. if (file_exists($fn)) {
  70. include $fn;
  71. }
  72. }
  73. }
  74. exit();
  75. }
  76.  
  77. // error messages
  78. $error_content = '';
  79. if ($errid) {
  80. $err = logger_get_error_string($errid);
  81. }
  82. if ($err) {
  83. $error_content = "<div class=error_string>$err</div>";
  84. }
  85. // frontpage
  86. if (valid()) {
  87. include $core_config['apps_path']['themes'].'/'.$core_config['module']['themes'].'/page_welcome.php';
  88. } else {
  89. include $core_config['apps_path']['themes'].'/'.$core_config['module']['themes'].'/page_login.php';
  90. }
  91. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement