Source for file core.php

Documentation is available at core.php

  1. <?php
  2.  
  3. ob_start();
  4.  
  5. session_start();
  6.  
  7. $GLOBALS['errorArray'] = array();
  8.  
  9.  
  10. // Include site header for access to all site script files
  11.  
  12. require_once "Core_Resources/core_header.php";
  13.  
  14.  
  15.  
  16.  
  17. //verify the database and initialize if not set up yet
  18.  
  19. if(!verify_core()){initialize_core();}
  20.  
  21.  
  22. if( !function_exists( 'allowed' ) ) { function allowed(){return true;} }
  23.  
  24.  
  25. if( !allowed( "view core" ) ) {
  26.  
  27. $unAuthorized = true;
  28.  
  29. header( "Location: http://".$_SERVER['HTTP_HOST']."/pi/Modules/people/login.php?error=unauthorized" );
  30.  
  31. } else {
  32.  
  33. core_start();
  34.  
  35. }
  36.  
  37.  
  38. ob_end_flush();
  39.  
  40. ?>
  41.  
  42. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  43.  
  44. <html>
  45.  
  46. <head>
  47.  
  48. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  49.  
  50. <title>pi Core Access</title>
  51.  
  52.  
  53.  
  54. <style type="text/css" media="screen">
  55.  
  56. @import url( Core_Resources/core-styles.css);
  57.  
  58. .style1 {font-size: 15%}
  59.  
  60. </style>
  61.  
  62. <script language="JavaScript" type="text/JavaScript">
  63.  
  64. <!--
  65.  
  66. function MM_goToURL() { //v3.0
  67.  
  68. var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  69.  
  70. for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
  71.  
  72. }
  73.  
  74. function MM_findObj(n, d) { //v4.01
  75.  
  76. var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  77.  
  78. d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  79.  
  80. if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  81.  
  82. for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  83.  
  84. if(!x && d.getElementById) x=d.getElementById(n); return x;
  85.  
  86. }
  87.  
  88.  
  89.  
  90. function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  91.  
  92. var obj = MM_findObj(objName);
  93.  
  94. if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
  95.  
  96. if (theValue == true || theValue == false)
  97.  
  98. eval("obj."+theProp+"="+theValue);
  99.  
  100. else eval("obj."+theProp+"='"+theValue+"'");
  101.  
  102. }
  103.  
  104. }
  105.  
  106. //-->
  107.  
  108. </script>
  109.  
  110. </head>
  111.  
  112. <body <?php
  113.  
  114. if($action){echo ' onload="MM_goToURL(\'parent\',\'core.php\');return document.MM_returnValue"';}?>>
  115.  
  116. <div id="centering" class="container">
  117.  
  118. <div id="rap">
  119.  
  120. <?php echo insert_corners(); ?>
  121.  
  122. <div id="header">
  123.  
  124. <div id="title_navigation">
  125.  
  126. <?php
  127.  
  128. if( !$unAuthorized ) {
  129.  
  130. ?>
  131.  
  132. <form method="post">
  133.  
  134. <a href="#" <?php echo mouseover(); ?>>core<<</a> <br>
  135.  
  136. <a href="Modules/system_beta_1/system_management.php" <?php echo mouseover(); ?>>modules</a> <br>
  137.  
  138. <?php
  139.  
  140. if( isset( $GLOBALS['user'] ) ) {
  141.  
  142. echo '
  143.  
  144. <input type="hidden" name="action" value="logout">
  145.  
  146. <input style="text-align:right;padding:0px;" type="button" class="submitLink" value="log out" '.mouseover().' onclick="this.form.submit();">
  147.  
  148. ';
  149.  
  150. } else {
  151.  
  152. echo '<a href="../people/login.php"'.mouseover().'>login</a>';
  153.  
  154. }
  155.  
  156. }
  157.  
  158. ?>
  159.  
  160. </form>
  161.  
  162. </div>
  163.  
  164. <div id="title_text">
  165.  
  166. core management
  167.  
  168. </div><!-- End title_text -->
  169.  
  170. </div><!-- End header -->
  171.  
  172. <div id="content">
  173.  
  174. <?php
  175.  
  176.  
  177.  
  178. if( $unAuthorized ) {
  179.  
  180. echo '
  181.  
  182. you are not authorized to view this page.
  183.  
  184. <p>please <a href="Modules/people/login.php" '.mouseover().'>log in </a> to view this page
  185.  
  186. ';
  187.  
  188. } else {
  189.  
  190. if( $_GET['p'] == "modules" || !$_GET['p'] ) {
  191.  
  192. echo core_get_modules_table();
  193.  
  194. } else if( $_GET['p'] == "objects" ) {
  195.  
  196. if( $_GET['object_type'] ) {
  197.  
  198. core_get_object_type_table();
  199.  
  200. } else {
  201.  
  202. core_get_object_types_table();
  203.  
  204. }
  205.  
  206. } else if( $_GET['p'] == "constraints" ) {
  207.  
  208. if( $_GET['constraint'] && $_GET['action'] != "delete_constraint" ) {
  209.  
  210. core_get_constraint_table();
  211.  
  212. } else {
  213.  
  214. core_get_constraints_table();
  215.  
  216. }
  217.  
  218. } else if( $_GET['p'] == "relationships" ) {
  219.  
  220. if( $_GET['relationship_type'] && $_GET['action'] != "delete_relationship_type" ) {
  221.  
  222. core_get_relationship_type_table();
  223.  
  224. } else {
  225.  
  226. core_get_relationship_types_table();
  227.  
  228. }
  229.  
  230. } else if( $_GET['p'] == "type_sets" ) {
  231.  
  232. if( $_GET['type_set'] && $_GET['action'] != "delete_type_set" ) {
  233.  
  234. core_get_type_set_table();
  235.  
  236. } else {
  237.  
  238. core_get_type_sets_table();
  239.  
  240. }
  241.  
  242. } else if( $_GET['p'] == "security" ) {
  243.  
  244. if( function_exists( people_get_permissions_content ) ) {
  245.  
  246. if( !$_GET['object'] ) { people_get_permissions_content(); }
  247.  
  248. else { people_get_permission_content(); }
  249.  
  250. } else { echo 'no security at this time - install people for security'; }
  251.  
  252. } else if( $_GET['p'] == "settings" ) {
  253.  
  254. echo core_get_settings();
  255.  
  256. }
  257.  
  258. }
  259.  
  260. ?>
  261.  
  262.  
  263.  
  264. </div><!-- End content -->
  265.  
  266. <div id="footer"><a href="#" onclick="MM_changeProp('centering','','style.display','none','DIV')">hide</a> |
  267.  
  268. <?php
  269.  
  270.  
  271.  
  272. $user =& $GLOBALS['user'];
  273.  
  274. if( $user ) {
  275.  
  276. echo get_object_index($user['id']).' logged in ';
  277.  
  278. }
  279.  
  280.  
  281.  
  282. if( !$unAuthorized ){
  283.  
  284. echo '
  285.  
  286. <a href="core.php?p=modules" '.mouseover().'>manage modules</a> | <a href="core.php?p=objects" '.mouseover().'>manage database structure</a> | <a href="core.php?p=security" '.mouseover().'>security settings</a> | <a href="core.php?p=settings" '.mouseover().'>core settings</a>
  287.  
  288. ';
  289.  
  290. }
  291.  
  292.  
  293.  
  294. ?>
  295.  
  296. </div>
  297.  
  298. </div><!-- End modules -->
  299.  
  300. </div><!-- End centering -->
  301.  
  302.  
  303.  
  304. </body>
  305.  
  306. </html>

Documentation generated on Tue, 24 May 2005 03:57:43 -0400 by phpDocumentor 1.3.0RC3