diff --git a/src/admin/groups.php b/src/admin/groups.php index 6fc1f67..2858456 100644 --- a/src/admin/groups.php +++ b/src/admin/groups.php @@ -71,11 +71,143 @@ if ( isset($_GET['op']) ) $content['groupname'] = ""; $content['groupdescription'] = ""; } + else if ($_GET['op'] == "adduser" && isset($_GET['id']) ) + { + //PreInit these values + $content['GROUPID'] = intval( DB_RemoveBadChars($_GET['id']) ); + + // Set Mode to add + $content['ISADDUSER'] = "true"; + $content['GROUP_FORMACTION'] = "adduser"; + $content['GROUP_SENDBUTTON'] = $content['LN_GROUP_ADDUSER']; + + // --- Get Groupname + $sqlquery = "SELECT " . + DB_GROUPS . ".groupname " . + " FROM " . DB_GROUPS . + " WHERE " . DB_GROUPS . ".id = " . $content['GROUPID']; + $result = DB_Query($sqlquery); + $tmparray = DB_GetSingleRow($result, true); + + if ( isset($tmparray) ) + { + // Copy Groupname + $content['GROUPNAME'] = $tmparray['groupname']; + + // --- Get Group Members + $sqlquery = "SELECT " . + DB_GROUPMEMBERS. ".userid " . + " FROM " . DB_GROUPMEMBERS . + " WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPID']; + $result = DB_Query($sqlquery); + $tmparray = DB_GetAllRows($result, true); + if ( count($tmparray) > 0 ) + { + // Add UserID's to where clause! + foreach ($tmparray as $datarow) + { + if ( isset($whereclause) ) + $whereclause .= ", " . $datarow['userid']; + else + $whereclause = " WHERE " . DB_USERS . ".id NOT IN (" . $datarow['userid']; + } + // Finish whereclause + $whereclause .= ") "; + } + else + $whereclause = ""; + // --- + + // --- Create LIST of Users which are available for selection + $sqlquery = "SELECT " . + DB_USERS. ".ID as userid, " . + DB_USERS. ".username " . + " FROM " . DB_USERS . + " LEFT OUTER JOIN (" . DB_GROUPMEMBERS . + ") ON (" . + DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " . + $whereclause . + " ORDER BY " . DB_USERS . ".username"; + $result = DB_Query($sqlquery); + $content['SUBUSERS'] = DB_GetAllRows($result, true); + + if ( count($content['SUBUSERS']) <= 0 ) + { + // Disable FORM: + $content['ISADDUSER'] = false; + + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERRORNOMOREUSERS'], $content['GROUPNAME'] ); + } + } + else + { + // Disable FORM: + $content['ISADDUSER'] = false; + + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] ); + } + // --- + } + else if ($_GET['op'] == "removeuser" && isset($_GET['id']) ) + { + //PreInit these values + $content['GROUPID'] = intval( DB_RemoveBadChars($_GET['id']) ); + + // Set Mode to add + $content['ISREMOVEUSER'] = "true"; + $content['GROUP_FORMACTION'] = "removeuser"; + $content['GROUP_SENDBUTTON'] = $content['LN_GROUP_USERDELETE']; + + // --- Get Groupname + $sqlquery = "SELECT " . + DB_GROUPS . ".groupname " . + " FROM " . DB_GROUPS . + " WHERE " . DB_GROUPS . ".id = " . $content['GROUPID']; + $result = DB_Query($sqlquery); + $tmparray = DB_GetSingleRow($result, true); + + if ( isset($tmparray) ) + { + // Copy Groupname + $content['GROUPNAME'] = $tmparray['groupname']; + + // --- Get Group Members + $sqlquery = "SELECT " . + DB_GROUPMEMBERS. ".userid, " . + DB_USERS. ".username " . + " FROM " . DB_GROUPMEMBERS . + " INNER JOIN (" . DB_USERS . + ") ON (" . + DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " . + " WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPID']; + $result = DB_Query($sqlquery); + $content['SUBRMUSERS'] = DB_GetAllRows($result, true); + if ( count($content['SUBRMUSERS']) <= 0 ) + { + // Disable FORM: + $content['ISREMOVEUSER'] = false; + + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERRORNOUSERSINGROUP'], $content['GROUPNAME'] ); + } + } + else + { + // Disable FORM: + $content['ISREMOVEUSER'] = false; + + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] ); + } + + } else if ($_GET['op'] == "edit") { // Set Mode to edit $content['ISEDITORNEWGROUP'] = "true"; - $content['GROUP_FORMACTION'] = "edituser"; + $content['GROUP_FORMACTION'] = "editgroup"; $content['GROUP_SENDBUTTON'] = $content['LN_GROUP_EDIT']; if ( isset($_GET['id']) ) @@ -154,76 +286,145 @@ if ( isset($_GET['op']) ) $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_INVALIDGROUP']; } } +} - if ( isset($_POST['op']) ) +if ( isset($_POST['op']) ) +{ + if ( isset ($_POST['id']) ) { $content['GROUPID'] = intval( DB_RemoveBadChars($_POST['id']) ); } else {$content['GROUPID'] = ""; } + if ( isset ($_POST['groupname']) ) { $content['groupname'] = DB_RemoveBadChars($_POST['groupname']); } else {$content['groupname'] = ""; } + if ( isset ($_POST['groupdescription']) ) { $content['groupdescription'] = DB_RemoveBadChars($_POST['groupdescription']); } else {$content['groupdescription'] = ""; } + + // Check mandotary values + if ( $content['groupname'] == "" ) { - if ( isset ($_POST['id']) ) { $content['GROUPID'] = DB_RemoveBadChars($_POST['id']); } else {$content['GROUPID'] = ""; } - if ( isset ($_POST['groupname']) ) { $content['groupname'] = DB_RemoveBadChars($_POST['groupname']); } else {$content['groupname'] = ""; } - if ( isset ($_POST['groupdescription']) ) { $content['groupdescription'] = DB_RemoveBadChars($_POST['groupdescription']); } else {$content['groupdescription'] = ""; } + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPEMPTY']; + } - - // Check mandotary values - if ( $content['groupname'] == "" ) + if ( !isset($content['ISERROR']) ) + { + // Everything was alright, so we go to the next step! + if ( $_POST['op'] == "addnewgroup" ) { - $content['ISERROR'] = true; - $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPEMPTY']; - } - - if ( !isset($content['ISERROR']) ) - { - // Everything was alright, so we go to the next step! - if ( $_POST['op'] == "addnewgroup" ) + $result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE groupname = '" . $content['groupname'] . "'"); + $myrow = DB_GetSingleRow($result, true); + if ( isset($myrow['groupname']) ) { - $result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE groupname = '" . $content['groupname'] . "'"); + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPNAMETAKEN']; + } + else + { + // Add new Group now! + $result = DB_Query("INSERT INTO " . DB_GROUPS . " (groupname, groupdescription) + VALUES ( '" . $content['groupname'] . "', + '" . $content['groupdescription'] . "' )"); + DB_FreeQuery($result); + + // Do the final redirect + RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], $content['groupname'] ) , "groups.php" ); + } + } + else if ( $_POST['op'] == "editgroup" ) + { + $result = DB_Query("SELECT ID FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID']); + $myrow = DB_GetSingleRow($result, true); + if ( !isset($myrow['ID']) ) + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] ); + } + else + { + // Edit the User now! + $result = DB_Query("UPDATE " . DB_GROUPS . " SET + groupname = '" . $content['groupname'] . "', + groupdescription = '" . $content['groupdescription'] . "' + WHERE ID = " . $content['GROUPID']); + DB_FreeQuery($result); + + // Done redirect! + RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], $content['groupname']) , "groups.php" ); + } + } + else if ( $_POST['op'] == "adduser" ) + { + if ( isset($_POST['userid']) ) + { + // Copy UserID + $content['USERID'] = intval( DB_RemoveBadChars($_POST['userid']) ); + + $result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE id = " . $content['USERID']); $myrow = DB_GetSingleRow($result, true); - if ( isset($myrow['groupname']) ) + if ( isset($myrow['username']) ) { - $content['ISERROR'] = true; - $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_GROUPNAMETAKEN']; - } - else - { - // Add new Group now! - $result = DB_Query("INSERT INTO " . DB_GROUPS . " (groupname, groupdescription) - VALUES ( '" . $content['groupname'] . "', - '" . $content['groupdescription'] . "' )"); + // Add Groupmembership now! + $result = DB_Query("INSERT INTO " . DB_GROUPMEMBERS . " (groupid, userid, is_member) + VALUES ( " . $content['GROUPID'] . ", + " . $content['USERID'] . ", + 1 )"); DB_FreeQuery($result); // Do the final redirect - RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_HASBEENADDED'], $content['groupname'] ) , "groups.php" ); - } - } - else if ( $_POST['op'] == "edituser" ) - { - $result = DB_Query("SELECT ID FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID']); - $myrow = DB_GetSingleRow($result, true); - if ( !isset($myrow['ID']) ) - { - $content['ISERROR'] = true; - $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_IDNOTFOUND'], $content['GROUPID'] ); + RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_USERHASBEENADDEDGROUP'], $myrow['username'], $content['groupname'] ) , "groups.php" ); } else { - // Edit the User now! - $result = DB_Query("UPDATE " . DB_GROUPS . " SET - groupname = '" . $content['groupname'] . "', - groupdescription = '" . $content['groupdescription'] . "' - WHERE ID = " . $content['GROUPID']); - DB_FreeQuery($result); - - // Done redirect! - RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_ERROR_HASBEENEDIT'], $content['groupname']) , "groups.php" ); + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] ); } + } + else + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_USERIDMISSING']; + } + } + else if ( $_POST['op'] == "removeuser" ) + { + if ( isset($_POST['userid']) ) + { + // Copy UserID + $content['USERID'] = intval( DB_RemoveBadChars($_POST['userid']) ); + + $result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE id = " . $content['USERID']); + $myrow = DB_GetSingleRow($result, true); + if ( isset($myrow['username']) ) + { + // remove user from group + $result = DB_Query( "DELETE FROM " . DB_GROUPMEMBERS . " WHERE userid = " . $content['USERID'] . " AND groupid = " . $content['GROUPID']); + if ($result == FALSE) + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_GROUP_ERROR_REMUSERFROMGROUP'], $myrow['username'], $content['groupname'] ); + } + else + DB_FreeQuery($result); + + // Do the final redirect + RedirectResult( GetAndReplaceLangStr( $content['LN_GROUP_USERHASBEENREMOVED'], $myrow['username'], $content['groupname'] ) , "groups.php" ); + } + else + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] ); + } + } + else + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_GROUP_ERROR_USERIDMISSING']; } } } } -else + +if ( !isset($_POST['op']) && !isset($_GET['op']) ) { // Default Mode = List Groups $content['LISTGROUPS'] = "true"; - // Read all Serverentries + // Read all Groupentries $sqlquery = "SELECT ID, " . " groupname, " . " groupdescription " . @@ -243,6 +444,34 @@ else else $content['GROUPS'][$i]['cssclass'] = "line2"; // --- + + // --- Read all Memberentries for this group + $sqlquery = "SELECT " . + DB_USERS. ".username, " . + DB_GROUPMEMBERS . ".userid, " . + DB_GROUPMEMBERS . ".groupid, " . + DB_GROUPMEMBERS . ".is_member " . + " FROM " . DB_GROUPMEMBERS . + " INNER JOIN (" . DB_USERS . + ") ON (" . + DB_GROUPMEMBERS . ".userid=" . DB_USERS . ".ID) " . + " WHERE " . DB_GROUPMEMBERS . ".groupid = " . $content['GROUPS'][$i]['ID'] . + " ORDER BY " . DB_USERS . ".username"; + $result = DB_Query($sqlquery); + $content['GROUPS'][$i]['USERS'] = DB_GetAllRows($result, true); + + if ( count($content['GROUPS'][$i]['USERS']) > 0 ) + { + // Enable Groupmembers + $content['GROUPS'][$i]['GROUPMEMBERS'] = true; + + // Process Groups + $subUserCount = count($content['GROUPS'][$i]['USERS']); + for($j = 0; $j < $subUserCount; $j++) + $content['GROUPS'][$i]['USERS'][$j]['seperator'] = ", "; + $content['GROUPS'][$i]['USERS'][$subUserCount-1]['seperator'] = ""; // last one is empty + } + // --- } // --- } diff --git a/src/admin/users.php b/src/admin/users.php index 8dfb82b..817074b 100644 --- a/src/admin/users.php +++ b/src/admin/users.php @@ -168,7 +168,7 @@ if ( isset($_GET['op']) ) if ( !isset($_SESSION['SESSION_USERNAME']) ) { $content['ISERROR'] = true; - $content['ERROR_MSG'] = $content['LN_USER_ERROR_WTFOMFGGG']; + $content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDSESSIONS']; } else { @@ -219,115 +219,116 @@ if ( isset($_GET['op']) ) $content['ERROR_MSG'] = $content['LN_USER_ERROR_INVALIDID']; } } +} - if ( isset($_POST['op']) ) +if ( isset($_POST['op']) ) +{ + if ( isset ($_POST['id']) ) { $content['USERID'] = DB_RemoveBadChars($_POST['id']); } else {$content['USERID'] = ""; } + if ( isset ($_POST['username']) ) { $content['USERNAME'] = DB_RemoveBadChars($_POST['username']); } else {$content['USERNAME'] = ""; } + if ( isset ($_POST['password1']) ) { $content['PASSWORD1'] = DB_RemoveBadChars($_POST['password1']); } else {$content['PASSWORD1'] = ""; } + if ( isset ($_POST['password2']) ) { $content['PASSWORD2'] = DB_RemoveBadChars($_POST['password2']); } else {$content['PASSWORD2'] = ""; } + if ( isset ($_POST['isadmin']) ) { $content['ISADMIN'] = 1; } else {$content['ISADMIN'] = 0; } + + + // Check mandotary values + if ( $content['USERNAME'] == "" ) { - if ( isset ($_POST['id']) ) { $content['USERID'] = DB_RemoveBadChars($_POST['id']); } else {$content['USERID'] = ""; } - if ( isset ($_POST['username']) ) { $content['USERNAME'] = DB_RemoveBadChars($_POST['username']); } else {$content['USERNAME'] = ""; } - if ( isset ($_POST['password1']) ) { $content['PASSWORD1'] = DB_RemoveBadChars($_POST['password1']); } else {$content['PASSWORD1'] = ""; } - if ( isset ($_POST['password2']) ) { $content['PASSWORD2'] = DB_RemoveBadChars($_POST['password2']); } else {$content['PASSWORD2'] = ""; } - if ( isset ($_POST['isadmin']) ) { $content['ISADMIN'] = 1; } else {$content['ISADMIN'] = 0; } + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_USER_ERROR_USEREMPTY']; + } - - // Check mandotary values - if ( $content['USERNAME'] == "" ) + if ( !isset($content['ISERROR']) ) + { + // Everything was alright, so we go to the next step! + if ( $_POST['op'] == "addnewuser" ) { - $content['ISERROR'] = true; - $content['ERROR_MSG'] = $content['LN_USER_ERROR_USEREMPTY']; - } - - if ( !isset($content['ISERROR']) ) - { - // Everything was alright, so we go to the next step! - if ( $_POST['op'] == "addnewuser" ) + $result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE username = '" . $content['USERNAME'] . "'"); + $myrow = DB_GetSingleRow($result, true); + if ( isset($myrow['username']) ) { - $result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE username = '" . $content['USERNAME'] . "'"); - $myrow = DB_GetSingleRow($result, true); - if ( isset($myrow['username']) ) + $content['ISERROR'] = true; + $content['ERROR_MSG'] = $content['LN_USER_ERROR_USERNAMETAKEN']; + } + else + { + // Check if Password is set! + if ( strlen($content['PASSWORD1']) <= 0 || + $content['PASSWORD1'] != $content['PASSWORD2'] ) { $content['ISERROR'] = true; - $content['ERROR_MSG'] = $content['LN_USER_ERROR_USERNAMETAKEN']; + $content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT']; } - else + + if ( !isset($content['ISERROR']) ) + { + // Create passwordhash now :)! + $content['PASSWORDHASH'] = md5( $content['PASSWORD1'] ); + + // Add new User now! + $result = DB_Query("INSERT INTO " . DB_USERS . " (username, password, is_admin) + VALUES ('" . $content['USERNAME'] . "', + '" . $content['PASSWORDHASH'] . "', + " . $content['ISADMIN'] . ")"); + DB_FreeQuery($result); + + // Do the final redirect + RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], $content['USERNAME'] ) , "users.php" ); + } + } + } + else if ( $_POST['op'] == "edituser" ) + { + $result = DB_Query("SELECT ID FROM " . DB_USERS . " WHERE ID = " . $content['USERID']); + $myrow = DB_GetSingleRow($result, true); + if ( !isset($myrow['ID']) ) + { + $content['ISERROR'] = true; + $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] ); + } + else + { + + // Check if Password is enabled + if ( isset($content['PASSWORD1']) && strlen($content['PASSWORD1']) > 0 ) { - // Check if Password is set! - if ( strlen($content['PASSWORD1']) <= 0 || - $content['PASSWORD1'] != $content['PASSWORD2'] ) + if ( $content['PASSWORD1'] != $content['PASSWORD2'] ) { $content['ISERROR'] = true; $content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT']; } if ( !isset($content['ISERROR']) ) - { + { // Create passwordhash now :)! $content['PASSWORDHASH'] = md5( $content['PASSWORD1'] ); - // Add new User now! - $result = DB_Query("INSERT INTO " . DB_USERS . " (username, password, is_admin) - VALUES ('" . $content['USERNAME'] . "', - '" . $content['PASSWORDHASH'] . "', - " . $content['ISADMIN'] . ")"); - DB_FreeQuery($result); - - // Do the final redirect - RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENADDED'], $content['USERNAME'] ) , "users.php" ); - } - } - } - else if ( $_POST['op'] == "edituser" ) - { - $result = DB_Query("SELECT ID FROM " . DB_USERS . " WHERE ID = " . $content['USERID']); - $myrow = DB_GetSingleRow($result, true); - if ( !isset($myrow['ID']) ) - { - $content['ISERROR'] = true; - $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID'] ); - } - else - { - - // Check if Password is enabled - if ( isset($content['PASSWORD1']) && strlen($content['PASSWORD1']) > 0 ) - { - if ( $content['PASSWORD1'] != $content['PASSWORD2'] ) - { - $content['ISERROR'] = true; - $content['ERROR_MSG'] = $content['LN_USER_ERROR_PASSSHORT']; - } - - if ( !isset($content['ISERROR']) ) - { - // Create passwordhash now :)! - $content['PASSWORDHASH'] = md5( $content['PASSWORD1'] ); - - // Edit the User now! - $result = DB_Query("UPDATE " . DB_USERS . " SET - username = '" . $content['USERNAME'] . "', - password = '" . $content['PASSWORDHASH'] . "', - is_admin = " . $content['ISADMIN'] . " - WHERE ID = " . $content['USERID']); - DB_FreeQuery($result); - } - } - else - { // Edit the User now! $result = DB_Query("UPDATE " . DB_USERS . " SET username = '" . $content['USERNAME'] . "', + password = '" . $content['PASSWORDHASH'] . "', is_admin = " . $content['ISADMIN'] . " WHERE ID = " . $content['USERID']); DB_FreeQuery($result); } - - // Done redirect! - RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], $content['USERNAME']) , "users.php" ); } + else + { + // Edit the User now! + $result = DB_Query("UPDATE " . DB_USERS . " SET + username = '" . $content['USERNAME'] . "', + is_admin = " . $content['ISADMIN'] . " + WHERE ID = " . $content['USERID']); + DB_FreeQuery($result); + } + + // Done redirect! + RedirectResult( GetAndReplaceLangStr( $content['LN_USER_ERROR_HASBEENEDIT'], $content['USERNAME']) , "users.php" ); } } } } -else + +if ( !isset($_POST['op']) && !isset($_GET['op']) ) { // Default Mode = List Users $content['LISTUSERS'] = "true"; diff --git a/src/images/icons/businessman_delete.png b/src/images/icons/businessman_delete.png new file mode 100644 index 0000000..52e2019 Binary files /dev/null and b/src/images/icons/businessman_delete.png differ diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 359fcda..911e17e 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -478,6 +478,7 @@ function InitFrontEndVariables() $content['MENU_DOCUMENTVIEW'] = $content['BASEPATH'] . "images/icons/document_view.png"; $content['MENU_DATAEDIT'] = $content['BASEPATH'] . "images/icons/data_edit.png"; $content['MENU_ADDUSER'] = $content['BASEPATH'] . "images/icons/businessman_add.png"; + $content['MENU_DELUSER'] = $content['BASEPATH'] . "images/icons/businessman_delete.png"; $content['MENU_ADD'] = $content['BASEPATH'] . "images/icons/add.png"; $content['MENU_EDIT'] = $content['BASEPATH'] . "images/icons/edit.png"; $content['MENU_DELETE'] = $content['BASEPATH'] . "images/icons/delete.png"; @@ -509,13 +510,13 @@ function GetAndReplaceLangStr( $strlang, $param1 = "", $param2 = "", $param3 = " { $strfinal = str_replace ( "%1", $param1, $strlang ); if ( strlen($param2) > 0 ) - $strfinal = str_replace ( "%1", $param2, $strfinal ); + $strfinal = str_replace ( "%2", $param2, $strfinal ); if ( strlen($param3) > 0 ) - $strfinal = str_replace ( "%1", $param3, $strfinal ); + $strfinal = str_replace ( "%3", $param3, $strfinal ); if ( strlen($param4) > 0 ) - $strfinal = str_replace ( "%1", $param4, $strfinal ); + $strfinal = str_replace ( "%4", $param4, $strfinal ); if ( strlen($param5) > 0 ) - $strfinal = str_replace ( "%1", $param5, $strfinal ); + $strfinal = str_replace ( "%5", $param5, $strfinal ); // And return return $strfinal; diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index b639a1e..c4d8de7 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -52,7 +52,6 @@ $content['LN_USER_DELETE'] = "Delete User"; $content['LN_USER_PASSWORD1'] = "Password"; $content['LN_USER_PASSWORD2'] = "Confirm Password"; $content['LN_USER_ERROR_IDNOTFOUND'] = "Error, User with ID '%1' , was not found"; -$content['LN_USER_ERROR_WTFOMFGGG'] = "Error, erm wtf you don't have a username omfg pls mowl?"; $content['LN_USER_ERROR_DONOTDELURSLF'] = "Error, you can not DELETE YOURSELF!"; $content['LN_USER_ERROR_DELUSER'] = "Deleting of the user with id '%1' failed!"; $content['LN_USER_ERROR_INVALIDID'] = "Error, invalid ID, User not found"; @@ -66,9 +65,11 @@ $content['LN_USER_ISADMIN'] = "Is Admin?"; $content['LN_USER_ADDEDIT'] = "Add/Edit User"; $content['LN_USER_WARNREMOVEADMIN'] = "You are about to revoke your own administrative priviledges. Are you sure to remove your admin status?"; $content['LN_USER_WARNDELETEUSER'] = "Are you sure that you want to delete the User '%1'? All his personal settings will be deleted as well."; +$content['LN_USER_ERROR_INVALIDSESSIONS'] = "Invalid User Session."; $content['LN_USER_'] = ""; // Group center +$content['LN_GROUP_CENTER'] = "Group Center"; $content['LN_GROUP_ID'] = "ID"; $content['LN_GROUP_NAME'] = "Groupname"; $content['LN_GROUP_DESCRIPTION'] = "Groupdescription"; @@ -87,8 +88,16 @@ $content['LN_GROUP_ERROR_INVALIDGROUP'] = "Error, invalid ID, Group not found"; $content['LN_GROUP_WARNDELETEGROUP'] = "Are you sure that you want to delete the Group '%1'? All Groupsettings will be deleted as well."; $content['LN_GROUP_ERROR_DELGROUP'] = "Deleting of the group with id '%1' failed!"; $content['LN_GROUP_ERROR_HASBEENDEL'] = "The Group '%1' has been successfully DELETED!"; -$content['LN_GROUP_'] = ""; -$content['LN_GROUP_'] = ""; +$content['LN_GROUP_MEMBERS'] = "Groupmembers: "; +$content['LN_GROUP_ADDUSER'] = "Add User to Group"; +$content['LN_GROUP_ERROR_USERIDMISSING'] = "The userid is missing."; +$content['LN_GROUP_USERHASBEENADDEDGROUP'] = "The User '%1' has been successfully added to group '%2'"; +$content['LN_GROUP_ERRORNOMOREUSERS'] = "There are no more available users who can be added to the group '%1'"; +$content['LN_GROUP_USER_ADD'] = "Add User to the group"; +$content['LN_GROUP_USERDELETE'] = "Remove a User from the group"; +$content['LN_GROUP_ERRORNOUSERSINGROUP'] = "There are no users to remove in this the group '%1'"; +$content['LN_GROUP_ERROR_REMUSERFROMGROUP'] = "The user '%1' could not be removed from the group '%2'"; +$content['LN_GROUP_USERHASBEENREMOVED'] = "The user '%1' has been successfully removed from the group '%2'"; $content['LN_GROUP_'] = ""; ?> \ No newline at end of file diff --git a/src/templates/admin/admin_groups.html b/src/templates/admin/admin_groups.html index 8dc9cbb..653f9bd 100644 --- a/src/templates/admin/admin_groups.html +++ b/src/templates/admin/admin_groups.html @@ -1,17 +1,19 @@ - -
{LN_USER_CENTER} | +{LN_GROUP_CENTER} | ||||
+
+
+ + {ERROR_MSG}+@@ -33,11 +35,25 @@ | {groupname} | {groupdescription} |
- |
||
{LN_GROUP_MEMBERS} | +
+
+ |
+ ||||