[geeklog-cvs] Geeklog-1.x/plugins/links functions.inc,1.97,1.98

Dirk Haun dhaun at qs1489.pair.com
Tue Jan 1 07:59:19 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/links
In directory qs1489.pair.com:/tmp/cvs-serv91560/plugins/links

Modified Files:
	functions.inc 
Log Message:
Keep submitter when approving a Links submission


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/links/functions.inc,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -d -r1.97 -r1.98
*** functions.inc	1 Jan 2008 12:33:48 -0000	1.97
--- functions.inc	1 Jan 2008 12:59:17 -0000	1.98
***************
*** 933,937 ****
      return array ('lid',
                    $_TABLES['links'],
!                   'lid,cid,url,description,title,date',
                    $_TABLES['linksubmission']);
  }
--- 933,937 ----
      return array ('lid',
                    $_TABLES['links'],
!                   'lid,cid,url,description,title,date,owner_id',
                    $_TABLES['linksubmission']);
  }
***************
*** 949,968 ****
  *
  */
! function plugin_moderationapprove_links ($id)
  {
      global $_TABLES, $_USER, $_GROUPS, $_LI_CONF;
  
!     $A = array ();
!     SEC_setDefaultPermissions ($A, $_LI_CONF['default_permissions']);
  
!     // Since the linksubmission table does not contain fields for the owner
!     // and group, we set those to the current user. Also set the default
!     // permissions as specified in the plugin's config.php
!     if (isset ($_GROUPS['Links Admin'])) {
          $group_id = $_GROUPS['Links Admin'];
      } else {
!         $group_id = SEC_getFeatureGroup ('links.moderate');
      }
!     DB_query ("UPDATE {$_TABLES['links']} SET owner_id = '{$_USER['uid']}', group_id = '$group_id', perm_owner = '{$A['perm_owner']}', perm_group = '{$A['perm_group']}', perm_members = '{$A['perm_members']}', perm_anon = '{$A['perm_anon']}' WHERE lid = '$id'");
  
      return '';
--- 949,969 ----
  *
  */
! function plugin_moderationapprove_links($id)
  {
      global $_TABLES, $_USER, $_GROUPS, $_LI_CONF;
  
!     // The linksubmission only keeps track of the submitter's uid, but not
!     // of grous and permissions. So set those to sensible defaults.
  
!     if (isset($_GROUPS['Links Admin'])) {
          $group_id = $_GROUPS['Links Admin'];
      } else {
!         $group_id = SEC_getFeatureGroup('links.moderate');
      }
! 
!     $A = array();
!     SEC_setDefaultPermissions($A, $_LI_CONF['default_permissions']);
! 
!     DB_query("UPDATE {$_TABLES['links']} SET group_id = '$group_id', perm_owner = '{$A['perm_owner']}', perm_group = '{$A['perm_group']}', perm_members = '{$A['perm_members']}', perm_anon = '{$A['perm_anon']}' WHERE lid = '$id'");
  
      return '';




More information about the geeklog-cvs mailing list