Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1207810
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 9, 5:39 AM
Size
13 KB
Mime Type
text/x-diff
Expires
Tue, Nov 11, 5:39 AM (6 h, 54 m)
Engine
blob
Format
Raw Data
Handle
789000
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/users/adduser_permissions.php
===================================================================
--- trunk/admin/users/adduser_permissions.php (revision 3000)
+++ trunk/admin/users/adduser_permissions.php (revision 3001)
@@ -1,222 +1,159 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
-define('REL_PATH', 'admin/users');
-if( !(isset($pathtoroot) && $pathtoroot) )
-{
- $path=dirname(realpath(__FILE__));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- if( !isset($pathtoroot) ) $pathtoroot = '';
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if( !(isset($pathtoroot) && $pathtoroot) )
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
+// new startup: begin
+define('REL_PATH', 'admin/users');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
-require_once($pathtoroot."kernel/startup.php");
-//admin only util
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-$localURL=$rootURL."kernel/";
-$adminURL = $rootURL.$admin;
-$imagesURL = $adminURL."/images";
-//$pathtolocal = $pathtoroot."in-news/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
//require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot. $value."admin/include/parser.php";
if(file_exists($path))
{
include_once($path);
}
}
unset($objEditItems);
$objEditItems = new clsUserManager();
$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser");
$objEditItems->EnablePaging = FALSE;
//Multiedit init
$en = GetVar('en');
$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
$itemcount=$objEditItems->NumItems();
$c = $objEditItems->GetItemByIndex($en);
if($itemcount>1)
{
if ($en+1 == $itemcount)
$en_next = -1;
else
$en_next = $en+1;
if ($en == 0)
$en_prev = -1;
else
$en_prev = $en-1;
}
$action = "m_edit_user";
$envar = "env=" . BuildEnv() . "&en=$en";
$section = 'in-portal:edituser_permissions';
$title = GetTitle("la_Text_User", "la_tab_Permissions", $c->Get('PortalUserId'), $c->Get('Login'));//prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."' - ".prompt_language("la_tab_Permissions");
$formaction = $adminURL."/user/adduser_permissions.php?".$envar;
$saveURL = $admin."/".$objSession->GetVariable('ReturnScript');
//Display header
$sec = $objSections->GetSection($section);
//echo "<pre>"; print_r($sec); echo "</pre>";
$objCatToolBar = new clsToolBar();
$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$saveURL."',1);","tool_select.gif");
$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$saveURL."',2);","tool_cancel.gif");
if ( isset($en_prev) || isset($en_next) )
{
$url = $RootUrl.$admin."/users/adduser_permissions.php";
$StatusField = "UserEditStatus";
$form = "edituser";
MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevUser','la_NextUser');
}
int_header($objCatToolBar,NULL,$title);
if ($objSession->GetVariable("HasChanges") == 1) {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
<tr>
<td valign="top">
<?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
</td>
</tr>
</table>
<?php } ?>
<TABLE CELLPADDING=0 CELLSPACING=0 class="tableborder" width="100%">
<TBODY>
<tr BGCOLOR="#e0e0da">
<td WIDTH="100%" CLASS="navar">
<img height="15" src="<?php echo $imagesURL; ?>/arrow.gif" width="15" align="middle" border="0">
<span class="NAV_CURRENT_ITEM"><?php echo prompt_language("la_Prompt_GeneralPermissions"); ?></span>
</td>
</TR>
</TBODY>
</TABLE>
<TABLE CELLPADDING=0 CELLSPACING=0 class="tableborder" width="100%">
<TBODY>
<FORM ID="edituser" NAME="edituser" method="POST" ACTION="">
<?php
$Mod_names = array();
$Mod_ids = array();
$Mod_names[] = admin_language("la_PermType_Admin");
$Mod_ids[] = "Admin";
$Mod_names[] = admin_language("la_PermType_Front");
$Mod_ids[] = "Front";
$UserId = $c->Get("PortalUserId");
for($i=0;$i<count($Mod_ids);$i++)
{
$module = $Mod_names[$i];
$mod_id = $Mod_ids[$i];
echo "<TR ".int_table_color_ret().">";
echo "<TD><IMG src=\"".$imagesURL."/itemicons/icon16_permission.gif\"> ";
$getvar = "?env=".BuildEnv()."&en=$en&module=$mod_id";
echo "<A class=\"NAV_URL\" HREF=\"".$adminURL."/users/user_addpermission.php$getvar\">$module</A></TD>";
echo "</TR>";
}
?>
</TBODY>
</TABLE>
<input type="hidden" name="ItemId" value="<?php echo $c->Get("ResourceId"); ?>">
<input type="hidden" name="Action" value="m_noop">
<input type="hidden" name="UserEditStatus" VALUE="0">
</FORM>
<FORM method="POST" NAME="save_edit" ID="save_edit">
<tr <?php int_table_color(); ?>>
<td colspan="3">
</td>
</tr>
</FORM>
<!-- CODE FOR VIEW MENU -->
<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>" name="viewmenu">
<input type="hidden" name="fieldname" value="">
<input type="hidden" name="varvalue" value="">
<input type="hidden" name="varvalue2" value="">
<input type="hidden" name="Action" value="">
</form>
<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
<script>
initSelectiorContainers();
</script>
<?php int_footer(); ?>
Property changes on: trunk/admin/users/adduser_permissions.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9
\ No newline at end of property
+1.10
\ No newline at end of property
Index: trunk/admin/tag_listing.php
===================================================================
--- trunk/admin/tag_listing.php (revision 3000)
+++ trunk/admin/tag_listing.php (revision 3001)
@@ -1,185 +1,123 @@
<?php
-if( !(isset($pathtoroot) && $pathtoroot) )
-{
- $path=dirname(realpath(__FILE__));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- if( !isset($pathtoroot) ) $pathtoroot = '';
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if( !(isset($pathtoroot) && $pathtoroot) )
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
+// new startup: begin
+define('REL_PATH', 'admin');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
-require_once($pathtoroot."kernel/startup.php");
include_once($pathtoroot."kernel/include/tag-class.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-$localURL=$rootURL."kernel/";
-$imagesURL = $rootURL."admin/images";
-$adminURL = $rootURL.$admin;
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot."admin/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot."admin/toolbar.php");
//Set Section
$section = "in-portal:tag_library";
//Set Environment Variable
$envar = "env=" . BuildEnv();
$sec = $objSections->GetSection($section);
$objCatToolBar = new clsToolBar();
$objCatToolBar->Add("img_save",
"la_Save",
"#",
"swap('img_save','toolbar/tool_select_f2.gif');",
"swap('img_save', 'toolbar/tool_select.gif');",
"javascript:history.back();",
"tool_select.gif");
$objCatToolBar->Add("img_cancel",
"la_Cancel",
"#",
"swap('img_cancel','toolbar/tool_cancel_f2.gif');",
"swap('img_cancel', 'toolbar/tool_cancel.gif');",
"javascript:history.back();",
"tool_cancel.gif");
$extra_styles = '<STYLE type="text/css">
<!--
.tag-listing {
border-collapse: collapse;
padding: 0px;
margin: 0px;
border: 0px;
background-color: #f6f6f6;
}
.tag-listing-row {font: 11px verdana}
.b-element {font: bold 13px}
.i-element {font: oblique 12px; background: #ebebeb;}
.header {
background: #999;
color: #fff;
}
-->
</STYLE>';
$title = admin_language("la_tag_library");
int_header($objCatToolBar,NULL,$title,NULL,$extra_styles);
$objTagList = new clsTagList();
$objTagList->Clear();
$objTagList->Query_Item("SELECT * FROM ".$objTagList->SourceTable);
?>
<table class="tag-listing" border="0" width="100%">
<?php
if($objTagList->NumItems()>0)
{
foreach($objTagList->Items as $i)
{
$i->LoadAttribs(); //echo " ".$i->attribs->NumItems()." Attributes<br>\n";
if( $i->Get("name") )
{
?>
<tr class="header">
<td class="b-element" colspan="2">
<?php echo ($i->Get("scope") != "global") ? $i->Get("scope").'.'.$i->Get("name") : $i->Get("name"); ?>
</td>
</tr>
<tr class="tag-listing-row">
<td colspan="2" class="i-element"><?php echo $i->Get("description"); ?></td>
</tr>
<tr class="tag-listing-row">
<td class="b-element" width="90%">Attributes:</td>
<td class="b-element" width="10%">Source example:</td>
</tr>
<tr>
<td>
<?php if( $i->attribs->NumItems() > 0 ) { // has attributes ?>
<!-- attributes listing: begin -->
<table border="0" width="100%" class="tag-listing">
<?php
foreach($i->attribs->Items as $a)
{
?>
<tr class="tag-listing-row">
<td valign="top"><?php echo $a->Get("Name").'['.$a->Get("AttrType").']'; ?></td>
<td><?php echo $a->Get("Description"); ?></td>
</tr>
<?php
}
?>
</table>
<!-- attributes listing: end -->
<?php } else{ ?> <?php } ?>
</td>
<td>
<!-- example -->
<?php
$example = $i->Get('example');
echo $example ? $example : ' ';
?>
</td>
</tr>
<?php
}
}
}
?>
</table>
<?php int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/tag_listing.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Event Timeline
Log In to Comment