diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php new file mode 100644 index 000000000..e2ef663f1 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_sgroup.php @@ -0,0 +1,40 @@ +getPermission(); + $result['no_visible_elements'] = 'FALSE'; + $result['username'] = $_SESSION['user']; + //global $SITEBASE; + //require($SITEBASE . '/inc/sgroup_list.php'); + //$result= array_merge($result, sgroup_list()); + //return helpers :: loadtemplate( 'sgroup_list', $result, true); + header("Location: ams?page=sgroup_list"); + exit; + + }else{ + //ERROR: No access! + $_SESSION['error_code'] = "403"; + header("Location: index.php?page=error"); + exit; + } + }else{ + //ERROR: not logged in! + header("Location: index.php"); + exit; + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_user_to_sgroup.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_user_to_sgroup.php new file mode 100644 index 000000000..924014f79 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/add_user_to_sgroup.php @@ -0,0 +1,43 @@ +getPermission()>1){ + $result['RESULT_OF_ADDING'] = Support_Group::addUserToSupportGroup($user_id, $id); + }else{ + $result['RESULT_OF_ADDING'] = "NOT_MOD_OR_ADMIN"; + } + + }else{ + $result['RESULT_OF_ADDING'] = "USER_NOT_EXISTING"; + } + $result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); + $result['no_visible_elements'] = 'FALSE'; + $result['username'] = $_SESSION['user']; + //global $SITEBASE; + //require_once($SITEBASE . 'inc/show_sgroup.php'); + //$result= array_merge($result, show_sgroup()); + //helpers :: loadtemplate( 'show_sgroup', $result); + header("Location: ams?page=show_sgroup&id=".$id); + exit; + + }else{ + //ERROR: No access! + $_SESSION['error_code'] = "403"; + header("Location: index.php?page=error"); + exit; + } + }else{ + //ERROR: not logged in! + header("Location: index.php"); + exit; + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php new file mode 100644 index 000000000..ade3c3af2 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/func/modify_email_of_sgroup.php @@ -0,0 +1,54 @@ +setGroupEmail($groupemail); + $group->setIMAP_MailServer(filter_var($_POST['IMAP_MailServer'],FILTER_SANITIZE_STRING)); + $group->setIMAP_Username(filter_var($_POST['IMAP_Username'],FILTER_SANITIZE_STRING)); + + //encrypt password! + global $cfg; + $crypter = new MyCrypt($cfg['crypt']); + $enc_password = $crypter->encrypt($password); + $group->setIMAP_Password($enc_password); + $group->update(); + $result['RESULT_OF_MODIFYING'] = "SUCCESS"; + if($password == ""){ + $result['RESULT_OF_MODIFYING'] = "NO_PASSWORD"; + } + }else{ + $result['RESULT_OF_MODIFYING'] = "EMAIL_NOT_VALID"; + } + + $result['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); + $result['no_visible_elements'] = 'FALSE'; + $result['username'] = $_SESSION['user']; + //global $SITEBASE; + //require_once($SITEBASE . 'inc/show_sgroup.php'); + //$result= array_merge($result, show_sgroup()); + //helpers :: loadtemplate( 'show_sgroup', $result); + header("Location: ams?page=show_sgroup&id=".$sgroupid); + exit; + + }else{ + //ERROR: No access! + $_SESSION['error_code'] = "403"; + header("Location: index.php?page=error"); + exit; + } + }else{ + //ERROR: not logged in! + header("Location: index.php"); + exit; + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php new file mode 100644 index 000000000..546395ed8 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/inc/sgroup_list.php @@ -0,0 +1,31 @@ +getName(); + $result['groupemail'] = $group->getGroupEmail(); + $result['imap_mailserver'] = $group->getIMAP_MailServer(); + $result['imap_username'] = $group->getIMAP_Username(); + $result['userlist'] = Gui_Elements::make_table(Support_Group::getAllUsersOfSupportGroup($result['target_id']), Array("getTUserId","getPermission","getExternId"), Array("tUserId","permission","externId")); + $i = 0; + foreach( $result['userlist'] as $user){ + $webuser = new Webusers($user['externId']); + $result['userlist'][$i]['name'] = $webuser->getUsername(); + $i++; + } + return $result; + + + }else{ + + //ERROR: No page specified! + $_SESSION['error_code'] = "404"; + header("Location: ams?page=error"); + exit; + } + + }else{ + //ERROR: No access! + $_SESSION['error_code'] = "403"; + header("Location: index.php?page=error"); + exit; + } + }else{ + //ERROR: not logged in! + header("Location: index.php"); + exit; + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/sgroup_list.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/sgroup_list.tpl new file mode 100644 index 000000000..231250fda --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/sgroup_list.tpl @@ -0,0 +1,105 @@ +{block name=content} + +
ID | +Name | +Tag | +Action | {/if} +|
---|---|---|---|---|
{$group.sGroupId} | +{$group.name} | +{$group.tag} | +{$group.groupemail} | + {if isset($isAdmin) && $isAdmin eq 'TRUE'}Delete | {/if} +
{$group_success}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "NAME_TAKEN"} + +{$group_name_taken}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "TAG_TAKEN"} + +{$group_tag_taken}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "SIZE_ERROR"} + +{$group_size_error}
+ + {/if} + + {/if} +{/block} + diff --git a/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_sgroup.tpl b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_sgroup.tpl new file mode 100644 index 000000000..0f1d55d17 --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/templates/show_sgroup.tpl @@ -0,0 +1,118 @@ +{block name=content} + +ID | +Name | + {if isset($isAdmin) && $isAdmin eq 'TRUE'}Action | {/if} + +
---|---|---|
{$user.tUserId} | +{$user.name} | + {if isset($isAdmin) && $isAdmin eq 'TRUE'}Delete | {/if} +
+ + | +
{$add_to_group_success}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "ALREADY_ADDED"} + +{$user_already_added}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "GROUP_NOT_EXISTING"} + +{$group_not_existing}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "USER_NOT_EXISTING"} + +{$user_not_existing}
+ + {else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "NOT_MOD_OR_ADMIN"} + +{$not_mod_or_admin}
+ + {/if} + + +