Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773366
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, Feb 2, 9:44 AM
Size
7 KB
Mime Type
text/x-diff
Expires
Tue, Feb 4, 9:44 AM (1 h, 39 m)
Engine
blob
Format
Raw Data
Handle
554831
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/users/addgroup.php
===================================================================
--- trunk/admin/users/addgroup.php (revision 999)
+++ trunk/admin/users/addgroup.php (revision 1000)
@@ -1,220 +1,225 @@
<?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. ##
##############################################################
if(!strlen($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 */
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(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
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");
unset($objEditItems);
$objEditItems = new clsGroupList();
$objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup");
$objEditItems->EnablePaging = FALSE;
$objCustomFields = new clsCustomFieldList(6);
$objUserGroupsList = new clsUserGroupList();
//$objRelList = new clsRelationshipList();
//Multiedit init
if ($_GET["new"] == 1)
{
$c = new clsPortalGroup(NULL);
$c->Set("CreatedOn", time());
$c->Set("EndOn", time());
$en = 0;
$action = "m_add_group";
$objGroups->CreateEmptyEditTable("GroupId");
// $objRelList->CreateEmptyEditTable("RelationshipId");
$objCustomDataList->CreateEmptyEditTable("CustomDataId");
$objUserGroupsList->CreateEmptyEditTable("PortalUserId");
}
else
{
$en = (int)$_GET["en"];
if (isset($_POST["itemlist"]))
{
$objGroups->CopyToEditTable("GroupId",$_POST["itemlist"]);
}
$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
if(isset($_POST["itemlist"]))
{
/* make a copy of the relationship records */
$ids = $objEditItems->GetResourceIDList();
$objCustomDataList->CopyToEditTable("ResourceId",$ids);
- $objUserGroupsList->CopyToEditTable("GroupId", $ids);
+
+ // map group ResourceIds to group ids (because from list we always get ResourceIds)
+ $db=&GetADODBConnection();
+ $group_ids=$db->GetCol('SELECT GroupId FROM '.$objGroups->SourceTable.' WHERE ResourceId IN ('.implode($ids).')');
+
+ $objUserGroupsList->CopyToEditTable("GroupId", $group_ids);
}
$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_group";
}
$envar = "env=" . BuildEnv() . "&en=$en";
$section = 'in-portal:editgroup_general';
if (strlen($c->Get("Name")))
$editing_title = $c->Get("Name");
else
$editing_title = "";
$title = GetTitle("la_Text_Group", "la_tab_General", $c->Get('GroupId'), $editing_title);//prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Group")." $editing_title- ".prompt_language("la_tab_General");
//echo $envar."<br>\n";
//Display header
$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');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',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('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',2);","tool_cancel.gif");
if ( isset($en_prev) || isset($en_next) )
{
$url = $RootUrl.$admin."/users/addgroup.php";
$StatusField = "GroupEditStatus";
$form = "editgroup";
MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevGroup','la_NextGroup');
}
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 width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<form ID="editgroup" name="editgroup" action="" method=POST>
<?php int_subsection_title(prompt_language("la_tab_Group")); ?>
<tr <?php int_table_color(); ?>>
<td valign="top"><span ID="prompt_group_name" class="text"><?php echo prompt_language("la_prompt_GroupName"); ?></span></td>
<td>
<input type="text" ValidationType="exists" tabindex="1" name="group_name" class="text" size="20" value="<?php echo inp_htmlize($c->parsetag("group_name")); ?>">
</td>
<td></td>
</tr>
<tr <?php int_table_color(); ?>>
<td valign="top"><span class="text"><?php echo prompt_language("la_prompt_Comments"); ?></span></td>
<td>
<textarea name="group_comments" tabindex="2" cols="30" rows="5" class="text"><?php echo inp_htmlize($c->Get("Description")); ?></textarea>
</td>
<td><span class="text"> </span></td>
</tr>
<tr <?php int_table_color(); ?>>
<td colspan="3">
<input type="hidden" name="Action" value="<?php echo $action; ?>">
<input type="hidden" name="group_id" value="<?php echo $c->parsetag("group_id"); ?>">
<input type="hidden" name="GroupEditStatus" VALUE="0">
</td>
</tr>
</FORM>
</table>
<SCRIPT language="JavaScript">
MarkAsRequired(document.getElementById("editgroup"));
</SCRIPT>
<?php int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/users/addgroup.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Event Timeline
Log In to Comment