Code

Reverted last changes, it is much more complicated as expected.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Nov 2008 13:30:23 +0000 (13:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Nov 2008 13:30:23 +0000 (13:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13009 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/main.php
gosa-core/ihtml/themes/default/framework.tpl
gosa-core/include/functions.inc

index 9a47467c43fe7d2fa71a62f3bbe3c8d4b75138ad..5ffd3d92e0c71ac3d47b793c2a3d7fd465f64712 100644 (file)
@@ -32,7 +32,6 @@ header("Content-type: text/html; charset=UTF-8");
 
 /* Set the text domain as 'messages' */
 $domain = 'messages';
-$object_id = "";
 bindtextdomain($domain, LOCALE_DIR);
 textdomain($domain);
 
@@ -178,22 +177,18 @@ if (session::is_set('plugin_dir')){
 } else {
   $old_plugin_dir= "";
 }
-
-if (isset($_GET['plug'])){
-  $plug=preg_replace("/:.*$/","",validate($_GET['plug'])); 
-  if($plist->plugin_access_allowed($plug)){
-    $plugin_dir= $plist->get_path($plug);
-    session::set('plugin_dir',$plugin_dir);
-    if ($plugin_dir == ""){
-      new log("security","gosa","",array(),"main.php called with invalid plug parameter \"$plug\"") ;
-      header ("Location: logout.php");
-      exit;
-    }
-  }else{
-    session::set('plugin_dir',"welcome");
-    $plugin_dir= "$BASE_DIR/plugins/generic/welcome";
+if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){
+  $plug= validate($_GET['plug']);
+  $plugin_dir= $plist->get_path($plug);
+  session::set('plugin_dir',$plugin_dir);
+  if ($plugin_dir == ""){
+    new log("security","gosa","",array(),"main.php called with invalid plug parameter \"$plug\"") ;
+    header ("Location: logout.php");
+    exit;
   }
 } else {
+
+  /* set to welcome page as default plugin */
   session::set('plugin_dir',"welcome");
   $plugin_dir= "$BASE_DIR/plugins/generic/welcome";
 }
@@ -363,11 +358,6 @@ if ($config->get_cfg_value("handleExpiredAccounts") == "true"){
 
 /* Load plugin */
 if (is_file("$plugin_dir/main.inc")){
-  $o_id = get_current_object_id();
-  if(!empty($o_id)){
-    $plug .= ":".base64_encode($o_id);
-    $_GET['plug'] .= ":".base64_encode($o_id);
-  }
   require_once ("$plugin_dir/main.inc");
 } else {
   msg_dialog::display(
@@ -415,12 +405,6 @@ $focus= '<script language="JavaScript" type="text/javascript">';
 $focus.= 'next_msg_dialog();';
 $focus.= '</script>';
 $smarty->assign("focus", $focus);
-$o_id = get_current_object_id();
-if(!empty($o_id)){
-  $smarty->assign("object_id", base64_encode($o_id));
-}else{
-  $smarty->assign("object_id", "");
-}
 
 $display= $header.$smarty->fetch(get_template_path('framework.tpl'));
 
index 205a6abccf15ee03c2e2e5fce3ff25b21bae5eed..4d9f8f9b1e87208f37c18944268836135d2e8883 100644 (file)
@@ -52,4 +52,4 @@
      </table>
     </td>
   </tr>
-</table>{$errors}{$focus}<input type='hidden' name='object_id' value='{$object_id}'><input type="hidden" name="php_c_check" value="1"></form></body></html>
+</table>{$errors}{$focus}<input type="hidden" name="php_c_check" value="1"></form></body></html>
index 0ab3e73c862605342ab18e6969d3868ca21845f5..ba46e840db640eba6469a22e0dd6418e9ac46c74 100644 (file)
@@ -2817,30 +2817,5 @@ function cred_decrypt($input,$password) {
 }
 
 
-function get_current_object_id()
-{
-  global $object_id;
-  if(empty($object_id)){
-    if(isset($_POST['object_id']) && !empty($_POST['object_id'])){
-      $object_id = base64_decode(validate($_POST['object_id']));
-    }elseif(isset($_GET['plug'])){
-      $object_id = base64_decode(preg_replace("/^.*:/","",validate($_GET['plug'])));
-    }
-  }
-  return($object_id);
-}
-
-
-function set_current_object($id,&$object)
-{
-  global $object_id;
-  if(!session::is_set('OBJECTS')){
-    session::set('OBJECTS', array());
-  }
-  $objs = &session::get('OBJECTS');
-  $objs[$id] = $object;
-  $object_id = $id;
-}
-
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>