summaryrefslogtreecommitdiffstats
path: root/ldap-site-mngmt/webinterface/rbs/menuposition_down.php
blob: d7b235ce60e2d75a843729a8e8b0c0393cf9444a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
include('../standard_header.inc.php');

$meDN = $_GET['dn'];
$oldpos = $_GET['pos'];

$pxeDN = $_GET['pxedn'];
$mnr = $_GET['mnr'];
$sbmnr = $_GET['sbmnr'];

$me = get_menuentries($pxeDN,array("cn"));
$maxpos = count($me);

$oldpos = preg_replace ( '/0([0-9])/', '$1', $oldpos);
if ($oldpos < $maxpos){
	
	$newpos = $oldpos +1;
	if (strlen($newpos) == 1){
		$newpos = "0".$newpos;
	}
	if (strlen($oldpos) == 1){
		$oldpos = "0".$oldpos;
	}
		
	if ($secmeDN = get_dn_menuposition($pxeDN,$newpos)){
		#echo "other meDN:"; print_r($secmeDN); echo "<br>";
		$entrysec ['menuposition'] = $oldpos;
		if ($result = ldap_mod_replace($ds,$secmeDN,$entrysec)){
			$entrymenu ['menuposition'] = $newpos;
			$result = ldap_mod_replace($ds,$meDN,$entrymenu);
		}
	}
}
$seconds = 0;
$url = "pxe.php?dn=".$pxeDN."&mnr=".$mnr."&sbmnr=".$sbmnr."&#menu";
$mesg = "";
#$mesg .= "<br>Sie werden automatisch auf die vorherige Seite zur&uuml;ckgeleitet. <br>				
#			Falls nicht, klicken Sie hier <a href=".$url." style='publink'>back</a>";
redirect($seconds, $url, $mesg, $addSessionId = TRUE);

?>