summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2026-03-27 15:25:22 +0000
committerlsces <lester@lsces.co.uk>2026-03-27 15:25:22 +0000
commitffeb8d9f82705f35372bf324f56ba9dae44eed2c (patch)
tree1b8756d56d76197e7b35fa7c71606937e618b6ba /admin
parent58a06634259893011a912c380ab78cf3c1bdc10e (diff)
downloadusers-ffeb8d9f82705f35372bf324f56ba9dae44eed2c.tar.gz
users-ffeb8d9f82705f35372bf324f56ba9dae44eed2c.tar.bz2
users-ffeb8d9f82705f35372bf324f56ba9dae44eed2c.zip
KernelTools usage
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/assign_role_user.php5
-rwxr-xr-xadmin/assign_user.php5
-rwxr-xr-xadmin/edit_group.php23
-rwxr-xr-xadmin/permissions.php8
-rwxr-xr-xadmin/users_import.php5
5 files changed, 26 insertions, 20 deletions
diff --git a/admin/assign_role_user.php b/admin/assign_role_user.php
index 4178a65..29d4927 100755
--- a/admin/assign_role_user.php
+++ b/admin/assign_role_user.php
@@ -7,18 +7,19 @@
// ASSIGN USER TO ROLES
// Initialization
require_once( '../../kernel/includes/setup_inc.php' );
+use Bitweaver\KernelTools;
$gBitSystem->verifyPermission( 'p_users_admin' );
if (!$gBitUser->userExists( array( 'user_id' => $_REQUEST["assign_user"] ) ) ) {
- $gBitSystem->fatalError( tra( "User doesnt exist" ));
+ $gBitSystem->fatalError( KernelTools::tra( "User doesnt exist" ));
}
$assignUser = new RolePermUser( $_REQUEST["assign_user"] );
$assignUser->load( true );
if( $assignUser->isAdmin() && !$gBitUser->isAdmin() ) {
- $gBitSystem->fatalError( tra( 'You cannot modify a system administrator.' ));
+ $gBitSystem->fatalError( KernelTools::tra( 'You cannot modify a system administrator.' ));
}
if( isset( $_REQUEST["action"] ) ) {
diff --git a/admin/assign_user.php b/admin/assign_user.php
index 73044fc..80757b3 100755
--- a/admin/assign_user.php
+++ b/admin/assign_user.php
@@ -7,11 +7,12 @@
// ASSIGN USER TO GROUPS
// Initialization
require_once( '../../kernel/includes/setup_inc.php' );
+use Bitweaver\KernelTools;
$gBitSystem->verifyPermission( 'p_users_admin' );
if (!$gBitUser->userExists( array( 'user_id' => $_REQUEST["assign_user"] ) ) ) {
- $gBitSystem->fatalError( tra( "User doesnt exist" ));
+ $gBitSystem->fatalError( KernelTools::tra( "User doesnt exist" ));
}
$assignUser = new BitPermUser( $_REQUEST["assign_user"] );
@@ -19,7 +20,7 @@ $assignUser->setCacheableObject( false );
$assignUser->load( true );
if( $assignUser->isAdmin() && !$gBitUser->isAdmin() ) {
- $gBitSystem->fatalError( tra( 'You cannot modify a system administrator.' ));
+ $gBitSystem->fatalError( KernelTools::tra( 'You cannot modify a system administrator.' ));
}
if( isset( $_REQUEST["action"] ) ) {
diff --git a/admin/edit_group.php b/admin/edit_group.php
index 5adaf6d..fe5bcec 100755
--- a/admin/edit_group.php
+++ b/admin/edit_group.php
@@ -5,6 +5,7 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once( '../../kernel/includes/setup_inc.php' );
+use Bitweaver\KernelTools;
// PERMISSIONS: NEEDS admin
$gBitSystem->verifyPermission( 'p_users_admin' );
@@ -31,12 +32,12 @@ if( !empty( $_REQUEST["cancel"] ) ) {
if( isset( $_REQUEST["confirm"] ) ) {
$gBitUser->batchAssignUsersToGroup( $_REQUEST['batch_assign'] );
} else {
- $gBitSystem->setBrowserTitle( tra( 'Confirm Batch Group Assignment' ) );
+ $gBitSystem->setBrowserTitle( KernelTools::tra( 'Confirm Batch Group Assignment' ) );
$formHash['batch_assign'] = $_REQUEST["batch_assign"];
$msgHash = array(
- 'label' => tra( 'Batch Assign Users to Group' ),
+ 'label' => KernelTools::tra( 'Batch Assign Users to Group' ),
'confirm_item' => $groupInfo['group_name'],
- 'warning' => tra( 'This will assign every user on the site to the group' ).' <strong>'.$groupInfo['group_name'].'</strong>',
+ 'warning' => KernelTools::tra( 'This will assign every user on the site to the group' ).' <strong>'.$groupInfo['group_name'].'</strong>',
);
$gBitSystem->confirmDialog( $formHash,$msgHash );
}
@@ -46,7 +47,7 @@ if( !empty( $_REQUEST["cancel"] ) ) {
$groupMembers = $gBitUser->getGroupUsers( $_REQUEST["members"] );
$gBitSmarty->assign( 'groupMembers', $groupMembers );
$mid = "bitpackage:users/group_list_members.tpl";
- $gBitSystem->setBrowserTitle( tra( 'Group Members' ).': '.$groupInfo['group_name'] );
+ $gBitSystem->setBrowserTitle( KernelTools::tra( 'Group Members' ).': '.$groupInfo['group_name'] );
} elseif( isset($_REQUEST["save"] ) ) {
if( empty($_REQUEST["name"] ) ) {
$_REQUEST["name"] = $_REQUEST["olgroup"];
@@ -79,10 +80,10 @@ if( !empty( $_REQUEST["cancel"] ) ) {
$successMsg = "The group ".$groupInfo['group_name']." was deleted.";
unset( $_REQUEST['group_id'] );
} else {
- $gBitSystem->setBrowserTitle( tra('Delete group') );
+ $gBitSystem->setBrowserTitle( KernelTools::tra( 'Delete group') );
$msgHash = array(
- 'confirm_item' => tra( 'Are you sure you want to permantly remove the group' )." <strong>$groupInfo[group_name]</strong>".'?',
- 'warning' => tra( 'This cannot be undone.' ),
+ 'confirm_item' => KernelTools::tra( 'Are you sure you want to permantly remove the group' )." <strong>$groupInfo[group_name]</strong>".'?',
+ 'warning' => KernelTools::tra( 'This cannot be undone.' ),
);
$gBitSystem->confirmDialog( $formHash,$msgHash );
}
@@ -105,7 +106,7 @@ if( !empty( $_REQUEST["cancel"] ) ) {
$successMsg = 'The permission '.$_REQUEST['permission'].' was removed successflly. <a href="'.USERS_PKG_URL.'admin/edit_group.php?action=assign&amp;perm='.$_REQUEST['permission'].'&amp;group_id='.$_REQUEST['group_id'].'&amp;pacakge='.$_REQUEST['package'].'">Undo last action.</a>';
} elseif( $_REQUEST["action"] == 'create' ) {
$mid = 'bitpackage:users/admin_group_edit.tpl';
- $gBitSystem->setBrowserTitle( tra( 'Create New Group' ) );
+ $gBitSystem->setBrowserTitle( KernelTools::tra( 'Create New Group' ) );
} elseif ($_REQUEST["action"] == 'assign') {
$gBitUser->assignPermissionToGroup($_REQUEST["perm"], $_REQUEST['group_id']);
}
@@ -127,7 +128,7 @@ if( !empty( $_REQUEST['group_id'] ) || (!empty( $_REQUEST["action"] ) && $_REQUE
$gBitSmarty->assign( 'contentList', $cList );
$gBitSmarty->assign( 'contentSelect', $contentSelect );
*/
- $contentTypes = array( '' => tra( 'All Content' ) );
+ $contentTypes = array( '' => KernelTools::tra( 'All Content' ) );
foreach( $gLibertySystem->mContentTypes as $cType ) {
$contentTypes[$cType['content_type_guid']] = $gLibertySystem->getContentTypeName( $cType['content_type_guid'] );
}
@@ -148,10 +149,10 @@ if( empty( $mid ) ) {
$gBitSmarty->assign( 'groupInfo', $groupInfo );
$gBitSmarty->assign( 'allPerms', $allPerms );
- $gBitSystem->setBrowserTitle( tra( 'Admininster Group' ).': '.$groupInfo['group_name'] );
+ $gBitSystem->setBrowserTitle( KernelTools::tra( 'Admininster Group' ).': '.$groupInfo['group_name'] );
$mid = 'bitpackage:users/admin_group_edit.tpl';
} else {
- $gBitSystem->setBrowserTitle( tra( 'Admin List Groups' ) );
+ $gBitSystem->setBrowserTitle( KernelTools::tra( 'Admin List Groups' ) );
$_REQUEST['group_id'] = 0;
$mid = 'bitpackage:users/admin_groups_list.tpl';
}
diff --git a/admin/permissions.php b/admin/permissions.php
index 909a3b3..2f6629f 100755
--- a/admin/permissions.php
+++ b/admin/permissions.php
@@ -1,5 +1,7 @@
<?php
require_once( '../../kernel/includes/setup_inc.php' );
+use Bitweaver\KernelTools;
+
$gBitSystem->verifyPermission( 'p_admin' );
$feedback = [];
@@ -25,14 +27,14 @@ if( !empty( $_REQUEST['save'] )) {
}
}
- $feedback['success'] = tra( "The permissions were successfully added to the requested groups." );
+ $feedback['success'] = KernelTools::tra( "The permissions were successfully added to the requested groups." );
// we need to update the groups list
$allGroups = $gBitUser->getAllGroups( $listHash );
}
// Check to see if we have unassigned permissions
if(( $unassignedPerms = $gBitUser->getUnassignedPerms() )) {
- $feedback['warning'] = tra( 'You have some permissions that are not assigned to any group. You need to assign these to at least one group each.' );
+ $feedback['warning'] = KernelTools::tra( 'You have some permissions that are not assigned to any group. You need to assign these to at least one group each.' );
$gBitSmarty->assign( 'unassignedPerms', $unassignedPerms );
}
@@ -42,5 +44,5 @@ $gBitSmarty->assign( 'permPackages', $gBitUser->getPermissionPackages() );
$gBitSmarty->assign( 'feedback', $feedback );
$gBitSmarty->assign( 'contentWithPermissions', LibertyContent::getContentWithPermissionsList() );
-$gBitSystem->display( 'bitpackage:users/admin_permissions.tpl', tra( 'Permission Maintenance' ), array( 'display_mode' => 'admin' ));
+$gBitSystem->display( 'bitpackage:users/admin_permissions.tpl', KernelTools::tra( 'Permission Maintenance' ), array( 'display_mode' => 'admin' ));
?>
diff --git a/admin/users_import.php b/admin/users_import.php
index 2dd7e2a..689c482 100755
--- a/admin/users_import.php
+++ b/admin/users_import.php
@@ -5,6 +5,7 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once( '../../kernel/includes/setup_inc.php' );
+use Bitweaver\KernelTools;
$gBitSystem->verifyPermission( 'p_users_admin' );
@@ -25,7 +26,7 @@ if( isset( $_REQUEST["batchimport"])) {
// is the file a valid CSV file?
if( empty( $fields[0] ) ) {
- $gBitSystem->fatalError( tra( "The file is not a CSV file or has not a correct syntax" ));
+ $gBitSystem->fatalError( KernelTools::tra( "The file is not a CSV file or has not a correct syntax" ));
}
//now load the users in a table
@@ -41,7 +42,7 @@ if( isset( $_REQUEST["batchimport"])) {
// were there any users in the list?
if( !is_array( $userRecords ) ) {
- $gBitSystem->fatalError( tra( "No records were found. Check the file please!" ));
+ $gBitSystem->fatalError( KernelTools::tra( "No records were found. Check the file please!" ));
}
// Process user array
$added = 0;