Пример #1
0
	$cookietab = '1';
}
if (!isset($_REQUEST['printpages']) && !isset($_REQUEST['printstructures'])) {
	$printpages = array();
	$printstructures = array();
	if (isset($_REQUEST["page_ref_id"])) {
		$info = $structlib->s_get_page_info($_REQUEST['page_ref_id']);
		if (!empty($info)) {
			$printstructures[] = $_REQUEST['page_ref_id'];
		}
	} elseif (isset($_REQUEST["page"]) && $tikilib->page_exists($_REQUEST["page"])) {
		$printpages[] = $_REQUEST["page"];
	}
} else {
	$printpages = TikiLib::tiki_unserialize(urldecode($_REQUEST["printpages"]));
	$printstructures = TikiLib::tiki_unserialize(urldecode($_REQUEST['printstructures']));
}
if (isset($_REQUEST["find"])) {
	$find = $_REQUEST["find"];
} else {
	$find = '';
}
$smarty->assign('find', $find);
if (isset($_REQUEST["addpage"])) {
	if (!in_array($_REQUEST["pageName"], $printpages)) {
		foreach ($_REQUEST['pageName'] as $value) {
			$printpages[] = $value;
		}
	}
	$cookietab = 2;
}
Пример #2
0
 function select_banner($zone, $target = '_blank', $id = '')
 {
     global $prefs, $tikilib;
     // Things to check
     // UseDates and dates
     // Hours
     // weekdays
     // zone
     // maxImpressions and impressions
     if (!empty($zone)) {
         $id = $this->select_banner_id($zone);
     }
     $res = $this->get_banner($id);
     $class = 'banner' . str_replace(' ', '_', $zone);
     $raw = '';
     switch ($res["which"]) {
         case 'useHTML':
             $raw = $res["HTMLData"];
             break;
         case 'useFlash':
             if ($prefs['javascript_enabled'] == 'y') {
                 global $headerlib;
                 include_once 'lib/headerlib.php';
                 $headerlib->add_jsfile('lib/swfobject/swfobject.js');
             }
             $raw = $tikilib->embed_flash(unserialize($res['HTMLData']));
             break;
         case 'useImage':
             $raw = "<div class='banner {$class}'><a target='{$target}' href='banner_click.php?id=" . $res["bannerId"] . "&amp;url=" . urlencode($res["url"]) . "'><img alt='banner' border='0' src=\"banner_image.php?id=" . $res["bannerId"] . "\" /></a></div>";
             break;
         case 'useFixedURL':
             @($fp = fopen($res["fixedURLData"], "r"));
             if ($fp) {
                 $raw = '';
                 while (!feof($fp)) {
                     $raw .= fread($fp, 4096);
                 }
                 fclose($fp);
             }
             break;
         case 'useText':
             $raw = "<a target='{$target}' class='bannertext' href='banner_click.php?id=" . $res["bannerId"] . "&amp;url=" . urlencode($res["url"]) . "'>" . $res["textData"] . "</a>";
             break;
     }
     // Increment banner impressions done in select_banner_id()
     // Now to set view limiting cookie for user
     $cookieName = "banner_{$zone}";
     $views = array();
     if (isset($_COOKIE[$cookieName])) {
         $views = TikiLib::tiki_unserialize($_COOKIE[$cookieName]);
     }
     if ($res['maxUserImpressions'] > 0) {
         $views[$res['bannerId']] = isset($views[$res['bannerId']]) ? $views[$res['bannerId']] + 1 : 1;
         $expire = $res['useDates'] ? $res['toDate'] : $tikilib->now + 60 * 60 * 24 * 90;
         //90 days
         setcookie($cookieName, serialize($views), $expire);
     }
     return $raw;
 }
}

if (isset($_REQUEST['copy'])) {
	$newPermissions = get_assign_permissions();
	$filter = TikiFilter::get('text');
	$to_copy = array(
					'perms' => $newPermissions->getPermissionArray(),
					'object' => $filter->filter($_REQUEST['objectId']),
					'type' => $filter->filter($_REQUEST['objectType'])
	);
	$_SESSION['perms_clipboard'] = serialize($to_copy);
}

if (!empty($_SESSION['perms_clipboard'])) {
	$perms_clipboard = TikiLib::tiki_unserialize($_SESSION['perms_clipboard']);
	$smarty->assign(
					'perms_clipboard_source',
					$perms_clipboard['type'] . (empty($perms_clipboard['object']) ? '' : ' : ') . $perms_clipboard['object']
	);

	if (isset($_REQUEST['paste'])) {
		$access->check_authenticity(tra('Are you sure you want paste the copied permissions onto this object?'));
		unset($_SESSION['perms_clipboard']);
		
		$set = new Perms_Reflection_PermissionSet;
	
		if ( isset( $perms_clipboard['perms'] ) ) {
			foreach ( $perms_clipboard['perms'] as $group => $gperms ) {
				foreach ( $gperms as $perm ) {
					$set->add($group, $perm);
Пример #4
0
if (!isset($_REQUEST['sendpages'])) {
	$sendpages = array();
} else {
	$sendpages = TikiLib::tiki_unserialize(urldecode($_REQUEST['sendpages']));
}

if (!isset($_REQUEST['sendstructures'])) {
	$sendstructures = array();
} else {
	$sendstructures = TikiLib::tiki_unserialize(urldecode($_REQUEST['sendstructures']));
}

if (!isset($_REQUEST['sendarticles'])) {
	$sendarticles = array();
} else {
	$sendarticles = TikiLib::tiki_unserialize(urldecode($_REQUEST['sendarticles']));
}

$smarty->assign('username', $_REQUEST['username']);
$smarty->assign('site', $_REQUEST['site']);
$smarty->assign('path', $_REQUEST['path']);
$smarty->assign('password', $_REQUEST['password']);

if (isset($_REQUEST['dbg'])) {
	$smarty->assign('dbg', $_REQUEST['dbg']);
}

if (isset($_REQUEST['find'])) {
	$find = $_REQUEST['find'];
} else {
	$find = '';