diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php index c0cb55bcb..19caea648 100755 --- a/e107_admin/users_extended.php +++ b/e107_admin/users_extended.php @@ -9,32 +9,152 @@ */ require_once('../class2.php'); + if (!getperms('4')) { e107::redirect('admin'); exit; } + + +include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE); + +if(varset($_GET['mode']) == "ajax") +{ + // Construct action string. + $action = varset($_GET['mode']) . '/' . varset($_GET['action']); + + switch($action) + { + case 'ajax/changeTable': + $tableName = varset($_POST['table_db'], null); + + if($tableName) + { + $sql = e107::getDb(); + + $sub_action = ''; + + if(e_QUERY) + { + $tmp = explode(".", e_QUERY); + $action = $tmp[0]; + $sub_action = varset($tmp[1], ''); + $id = varset($tmp[2], 0); + unset($tmp); + } + + if($sql->select('user_extended_struct', '*', "user_extended_struct_id = '{$sub_action}'")) + { + $current = $sql->fetch(); + } + else + { + $current = 'new'; + } + + $currVal = $current['user_extended_struct_values']; + $curVals = explode(",", varset($currVal)); + + // Ajax URL for "Table" dropdown. + $ajaxGetTableSrc = e_SELF . '?mode=ajax&action=changeTable'; + + $text = "