function user_identification($m) { user_auth(); user_login_check(); user_update_database($m); user_check_url_rewrite(); }
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('5'); $admin_tmpl['folders_main'] = true; $folders = get_unserialized_array('folders'); $files_count = get_files_count('folders'); if (isset($_POST['action']) && $_POST['action'] == 'add') { if (isset($_POST['folder_name']) && !empty($_POST['folder_name'])) { $auto_id = file_exists($file['id_folders']) ? trim(file_get_contents($file['id_folders'])) : 1; $folder_parent = isset($_POST['folder_parent']) ? (int) $_POST['folder_parent'] : 0; $folders[$auto_id] = array('name' => check_text($_POST['folder_name'], true), 'parent_id' => $folder_parent); if (mn_put_contents($file['folders'], DIE_LINE . serialize($folders))) { mn_put_contents($file['id_folders'], $auto_id + 1); header('location: ./mn-folders.php?back=added&f=' . $auto_id); exit; } else { overal_header($lang['folders_folders'], $lang['folders_msg_put_contents_error'], 'error'); } } else { overall_header($lang['folders_folders'], $lang['folders_msg_empty_folder_name'], 'error'); } } elseif (isset($_POST['action']) && $_POST['action'] == 'edit' && isset($_POST['id']) && array_key_exists($_POST['id'], $folders)) { if (!empty($_POST['folder_name'])) { $folders[$_POST['id']] = array('name' => check_text($_POST['folder_name'], true), 'parent_id' => (int) $_POST['folder_parent']); if (mn_put_contents($file['folders'], DIE_LINE . serialize($folders))) { header('location: ./mn-folders.php?back=edited&f=' . $_POST['id']); exit; } else { overal_header($lang['folders_folders'], $lang['folders_msg_put_contents_error'], 'error'); }
$t_groups = array(); $t_groups = load_basic_data('templates_groups'); if (file_exists(MN_ROOT . $file['posts'])) { $p_file = file(MN_ROOT . $file['posts']); array_shift($p_file); $authors = array(); foreach ($p_file as $p_line) { $post = get_values('posts', $p_line, false); $authors[] = $post['author']; } $authors = array_unique($authors); } else { $authors = array(); } } elseif (isset($_POST['action']) && $_POST['action'] == 'wizard') { $auth = user_auth('12'); $wizard_code = ''; if (!empty($_POST['count']) && is_numeric($_POST['count'])) { $wizard_code .= '$mn_count = ' . $_POST['count'] . ';' . "\n "; } if (isset($_POST['categories']) && !empty($_POST['categories'])) { sort($_POST['categories']); $categories = trim(implode(',', $_POST['categories']), ','); $wizard_code .= "\$mn_cat = '" . $categories . "';\n "; } if (isset($_POST['author']) && !empty($_POST['author']) && is_numeric($_POST['author'])) { $wizard_code .= "\$mn_author = " . $_POST['author'] . ";\n "; } if (isset($_POST['template']) && !empty($_POST['template'])) { $wizard_code .= "\$mn_tmpl = '" . $_POST['template'] . "';\n "; }
3. Each form is submitted when the selection is changed 4. When a form is submitted with a set user id in the POST, then a record in the assignments table is either inserted or updated.*/ session_start(); include 'include/header.html'; require 'include/config.inc.php'; require 'model/data_functions.php'; $user_id = $_SESSION['user_id']; // Assign the sessions varibles $email = $_SESSION['email']; $page = $_SERVER['REQUEST_URI']; // Assign URL to use in the form action- This will include the GET date for the week of Monday... $nav_href = 'edit_tms.php?monday='; // For use in week_nav() $meeting = 'tms'; $user_auth = 'fail'; $user_auth =& user_auth($user_id, $email, $meeting); if ($user_auth == 0) { // If either public or admin is TRUE (1), then the script continue require 'include/login_functions.inc.php'; redirect_user('index.php'); } else { require 'include/functions.inc.php'; require 'include/functions_date.php'; $monday = $_GET['monday']; // Date value from URL. Always represents the date of a Monday of the week. $date = date('F j, Y', strtotime($monday)); $midweek = date('F j, Y', strtotime('+2 days', strtotime($monday))); $sunday = date('F j, Y', strtotime('+6 days', strtotime($monday))); $view = 'date'; $page_id = 3; $meeting_type_id = 1;
} } else { $u_file = file($file['users']); array_shift($u_file); $users_result = ''; $users = array(); $groups = load_basic_data('groups'); $posts_count = get_posts_count('users'); foreach ($u_file as $single_line) { $temp_data = explode(DELIMITER, $single_line); $users[$temp_data[0]] = $temp_data[1] . DELIMITER . $temp_data[3] . DELIMITER . $temp_data[4]; } $users = mn_natcasesort($users); foreach ($users as $user_id => $temp_data) { $u_data = explode(DELIMITER, $temp_data); if (user_auth('1', true)) { $user_posts_count = !isset($posts_count[$user_id]) || empty($posts_count[$user_id]) ? '<span class="trivial">0</span>' : '<a href="./mn-posts.php?a=' . $user_id . '">' . $posts_count[$user_id] . '</a>'; } else { $user_posts_count = !isset($posts_count[$user_id]) || empty($posts_count[$user_id]) ? '0' : '' . $posts_count[$user_id] . ''; } $delete_link = $user_id == 1 || $user_id == $_SESSION['mn_user_id'] ? '' : ' · <a href="./mn-users.php?action=delete&id=' . $user_id . '" class="fancy">' . $lang['uni_delete'] . '</a>'; if (count($users) > 2) { $star = $user_id == $_SESSION['mn_user_id'] ? ' <img src="./stuff/img/icons/star.png" alt="" />' : ''; } else { $star = ''; } $users_result .= '<tr><td><a href="./mn-users.php?action=edit&id=' . $user_id . '" class="main-link">' . $u_data[0] . '</a>' . $star . '<br /> <span class="links hide"><a href="./mn-users.php?action=edit&id=' . $user_id . '">' . $lang['uni_edit'] . '</a>' . $delete_link . '</span></td><td>' . $u_data[1] . '</td><td>' . $groups[$u_data[2]] . '</td><td class="c cell-posts">' . $user_posts_count . '</td></tr>'; } if (isset($_GET['back']) && $_GET['back'] == 'added') { overall_header($lang['users_users'], $lang['users_msg_user_added'], 'ok'); } elseif (isset($_GET['back']) && $_GET['back'] == 'deleted') {
include "config.php"; $FARS = new FARS(); function user_auth($username, $password) { global $FARS; $code = $FARS->encrypt($password); $res = mysql_fetch_row($FARS->get_mysql('user', 'count(*)', "`username` = '{$username}' AND `password` = '{$code}'", false, true)); if ('0' !== $res[0]) { return true; } else { return false; } } $display = "display:none"; if (isset($_REQUEST['submit'])) { if (user_auth(@$_REQUEST['username'], @$_REQUEST['password'])) { setcookie('username', $_REQUEST['username']); header("Location:list.php"); } else { $display = ""; } } include_once "header.php"; ?> <div class="ui middle aligned center aligned grid"> <div class="column"> <h2 class="ui blue header"> <div class="content"> 登入 </div>
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('4'); if (!isset($_COOKIE["TinyMCE_text_size"])) { setcookie("TinyMCE_text_size", "cw=810&ch=300", time() + 60 * 60 * 24 * 365); } if (!file_exists('./' . $file['pages'])) { $p_dir = dir($dir['pages']); $pages = array(); while ($p_file = $p_dir->read()) { if (!is_file($dir['pages'] . $p_file)) { continue; } else { $var = get_page_data($p_file, false); if (isset($var['author']) && !empty($var['author'])) { $pages[$var['id']] = array('id' => $var['id'], 'timestamp' => $var['timestamp'], 'title' => $var['title'], 'friendly_url' => $var['friendly_url'], 'author' => $var['author'], 'parent_id' => 0, 'order' => $var['order']); } else { continue; } } } mn_put_contents($file['pages'], DIE_LINE . serialize($pages)); } if (isset($_GET['action']) && $_GET['action'] == 'add') { $var['title'] = ''; $var['text'] = ''; $var['xfields_array'] = array(); overall_header($lang['pages_add_new_page'], $lang['pages_add_new_page'], 'main', true); $admin_tmpl['form'] = true; } elseif (isset($_POST['action']) && $_POST['action'] == 'add') {
?> </button> </p> </fieldset> </form> <?php if (isset($_GET['nofancy'])) { overall_footer(); } die; } if (isset($admin_tmpl['form_posts_list']) && $admin_tmpl['form_posts_list']) { echo '<div class="simbutton fl"><a href="./mn-posts.php?action=add"><img src="./stuff/img/icons/add.png" alt="" width="16" height="16" /> ' . $lang['posts_add_new_post'] . '</a></div>'; echo '<div class="rel-links">'; if (user_auth('2', true)) { echo '<a href="./mn-categories.php" class="custom"><img src="./stuff/img/icons/categories.png" alt="" width="16" height="16" /> ' . $lang['cats_categories'] . '</a>'; if (file_exists(MN_ROOT . $file['tags'])) { echo ' · <a href="./mn-tags.php" class="custom"><img src="./stuff/img/icons/tags.png" alt="" width="16" height="16" /> ' . $lang['tags_tags'] . '</a>'; } } if (empty($_GET['c']) && empty($_GET['t']) && empty($_GET['a']) && empty($_GET['d']) && empty($_GET['s']) && empty($_GET['q']) && empty($posts_result)) { echo ''; } elseif (empty($_GET['c']) && empty($_GET['t']) && empty($_GET['a']) && empty($_GET['d']) && empty($_GET['s']) && empty($_GET['q'])) { echo ' · <span class="simurl" id="filter-viewer"> <img src="./stuff/img/icons/view-settings.png" alt="" width="16" height="16" /> ' . $lang['posts_filter_settings'] . '</span>'; } else { echo ' · <a href="./mn-posts.php" class="custom"><img src="./stuff/img/icons/view-settings-cancel.png" alt="" width="16" height="16" /> ' . $lang['posts_filter_cancel'] . '</a>'; } echo '</div>'; $class = empty($_GET['c']) && empty($_GET['t']) && empty($_GET['a']) && empty($_GET['d']) && empty($_GET['s']) && empty($_GET['q']) || isset($_GET['approve']) ? ' hide' : ''; echo '<p class="cleaner"> </p><form action="./mn-posts.php" method="get" class="filter' . $class . '">';
$password = $_REQUEST['password']; // process advanced options to pass to radclient isset($_REQUEST['debug']) ? $debug = $_REQUEST['debug'] : ($debug = "no"); isset($_REQUEST['timeout']) ? $timeout = $_REQUEST['timeout'] : ($timeout = 3); isset($_REQUEST['retries']) ? $retries = $_REQUEST['retries'] : ($retries = 3); isset($_REQUEST['count']) ? $count = $_REQUEST['count'] : ($count = 1); isset($_REQUEST['retries']) ? $requests = $_REQUEST['requests'] : ($requests = 3); // create the optional arguments variable // convert the debug = yes to the actual debug option which is "-x" to pass to radclient if ($debug == "yes") { $debug = "-x"; } else { $debug = ""; } $options = array("count" => $count, "requests" => $requests, "retries" => $retries, "timeout" => $timeout, "debug" => $debug, "dictionary" => $dictionaryPath); $successMsg = user_auth($options, $username, $password, $radius, $radiusport, $secret); $logAction = "Informative action performed on user [{$username}] on page: "; } include_once 'library/config_read.php'; $log = "visited page: "; ?> <?php include "menu-config-maint.php"; ?> <?php include_once "library/tabber/tab-layout.php"; ?>
} else { // duh? die; } // Check if use has session @session_start(); if (!empty($_SESSION['YACOMASVARS'][$sess_id]) && $exp != 'exp') { header("Location: {$return_url}"); exit; //no needed } if (!empty($submit)) { if (empty($passwd) || !preg_match("/^\\w{4,15}\$/", $login)) { $errmsg[] = __("Usuario y/o contraseña no válidos. Por favor trate de nuevo."); } else { $user = user_auth($login, $passwd, Context); if (empty($user->id)) { $errmsg[] = __("Usuario y/o contraseña incorrectos. Por favor intente de nuevo o puede ingresar a") . " <a href=\"{$return_url}/reset.php\">" . __("Recuperar Contraseña") . "</a>"; } else { // User ok, init session data @session_start(); // ignore errors session_register('YACOMASVARS'); if (Context == 'admin') { $_SESSION['YACOMASVARS']['rootid'] = $user->id; $_SESSION['YACOMASVARS']['rootlogin'] = $user->login; $_SESSION['YACOMASVARS']['rootlevel'] = $user->id_tadmin; $_SESSION['YACOMASVARS']['rootlast'] = time(); } elseif (Context == 'ponente') { $_SESSION['YACOMASVARS']['ponid'] = $user->id; $_SESSION['YACOMASVARS']['ponlogin'] = $user->login;
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('8'); if (isset($_GET['action']) && $_GET['action'] == 'theme') { $theme_dir = MN_ROOT . DIR_THEMES . $conf['admin_theme'] . '/'; $theme_config = $theme_dir . 'theme_config.php'; if (file_exists($theme_config)) { include $theme_config; @(include_once MN_ROOT . 'data/databases/theme_config.php'); if (isset($theme['name']) && $theme['name'] != $conf['admin_theme']) { unset($theme); include $theme_config; } $theme_result = ''; foreach ($theme as $key => $value) { if ($key == 'name' || substr($key, -3, 3) == '-va' || substr($key, -3, 3) == '-ha' || substr($key, -4, 4) == '-rep' || substr($key, -4, 4) == '-att') { continue; } elseif (substr($key, -4, 4) == '_img') { $theme_result .= '<tr><td class="r"><label for="' . $key . '">' . $key . ':</label></td><td class="l"><input type="text" name="' . $key . '" placeholder="URL" id="' . $key . '" class="extra" value="' . $value . '" /><br /> <select name="' . $key . '-va"> <option value="top"' . (isset($theme[$key . '-va']) && $theme[$key . '-va'] == 'top' ? ' selected="selected"' : '') . '>top</option> <option value="center"' . (!isset($theme[$key . '-va']) || $theme[$key . '-va'] == 'center' ? ' selected="selected"' : '') . '>center</option> <option value="bottom"' . (isset($theme[$key . '-va']) && $theme[$key . '-va'] == 'bottom' ? ' selected="selected"' : '') . '>bottom</option> </select> <select name="' . $key . '-ha"> <option value="left"' . (isset($theme[$key . '-ha']) && $theme[$key . '-ha'] == 'left' ? ' selected="selected"' : '') . '>left</option> <option value="center"' . (!isset($theme[$key . '-ha']) || $theme[$key . '-ha'] == 'center' ? ' selected="selected"' : '') . '>center</option> <option value="right"' . (isset($theme[$key . '-ha']) && $theme[$key . '-ha'] == 'right' ? ' selected="selected"' : '') . '>right</option> </select> <select name="' . $key . '-rep">
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('2'); $admin_tmpl['cats_main'] = true; $categories = load_basic_data('categories'); if (file_exists($file['categories_order'])) { $categories_order = unserialize(file_get_contents($file['categories_order'])); } else { $categories_order = array(); $i = 1; foreach ($categories as $id => $cname) { $categories_order[$i] = $id; $i++; } mn_put_contents($file['categories_order'], serialize($categories_order)); } $posts_count = get_posts_count(); if (isset($_REQUEST['action']) && isset($_REQUEST['id'])) { $var = get_values('categories', $_REQUEST['id']); } if (isset($_GET['action']) && $_GET['action'] == 'ajaxcall') { if (isset($_GET['cat_name']) && !empty($_GET['cat_name']) && !in_array($_GET['cat_name'], $categories)) { if (file_exists($file['categories'])) { $cats_file = file($file['categories']); $cats_file_lines = ''; foreach ($cats_file as $single_line) { $cat_data = explode(DELIMITER, $single_line); if (substr($cat_data[0], 0, 2) == '<?') { $auto_increment_id = trim($cat_data[1]); } else {
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('14'); if (isset($_GET['id']) && user_auth('6', true) == '1') { $uid = $_GET['id']; } else { $uid = $_SESSION['mn_user_id']; } if (isset($_POST['action']) && $_POST['action'] == 'doit:)') { if (check_email($_POST['email'])) { $old = get_values('users', $_SESSION['mn_user_id']); // no pass change, no e-mail change if (empty($_POST['pass1']) && $old['email'] == $_POST['email']) { $put['pass'] = $old['pass']; $put['email'] = $old['email']; $action['continue'] = true; } elseif (!empty($_POST['pass1']) && $old['email'] != $_POST['email'] && $_POST['pass1'] === $_POST['pass2']) { if ($old['pass'] == sha1($_POST['pass0']) && $_POST['pass1'] === $_POST['pass2']) { $put['pass'] = sha1($_POST['pass1']); $put['email'] = $_POST['email']; $action['continue'] = true; } else { $action['continue'] = false; $error_message = $lang['users_msg_wrong_old_password']; } } elseif (empty($_POST['pass1']) && $old['email'] != $_POST['email']) { if ($old['pass'] == sha1($_POST['pass0'])) { $put['pass'] = $old['pass']; $put['email'] = $_POST['email']; $action['continue'] = true;
echo '<div id="comments-title">' . $lang['posts_post_comments'] . '</div>'; $i = 1; foreach ($c_file as $c_line) { $c_var = get_values('comments', $c_line, false); echo '<div class="comment" id="c-' . $c_var['comment_id'] . '"><span class="info">[<a href="#c-' . $c_var['comment_id'] . '">' . $i . '</a>] <strong>' . $c_var['author_name'] . '</strong> ' . date('d.m.Y H:i', $c_var['timestamp']); echo user_auth('3', true) ? '<span class="links hide"> <a href="./mn-comments.php?action=reply&post=' . $c_var['post_id'] . '" class="fancy">' . $lang['comm_reply'] . '</a> · <a href="./mn-comments.php?action=edit&post=' . $c_var['post_id'] . '&id=' . $c_var['comment_id'] . '">' . $lang['uni_edit'] . '</a> · <a href="./mn-comments.php?a=m&s=0&f=' . $c_var['post_id'] . '&c=' . $c_var['comment_id'] . '&t=' . $_SESSION['mn_token'] . '&from=post" class="ajaxcall">' . $lang['uni_delete'] . '</a></span>' : ''; echo '</span><br />' . comment_format($c_var['comment_text']) . '</div>'; $i++; } } else { echo '<div id="no-comments" class="round"><img src="./stuff/img/icons/information.png" alt="" /> ' . $lang['comm_msg_post_no_comments'] . '</div>'; } } else { include './stuff/inc/mn-start.php'; define('MN_LOGGED', true); $auth = user_auth('3'); if (isset($_GET['action']) && $_GET['action'] == 'reply' && file_exists($dir['comments'] . 'comments_' . $_GET['post'] . '.php')) { $admin_tmpl['comment_reply'] = true; } elseif (isset($_POST['action']) && $_POST['action'] == 'reply' && isset($_POST['c_text']) && !empty($_POST['c_text']) && file_exists($dir['comments'] . 'comments_' . $_POST['post'] . '.php')) { $c_content = file_get_contents($dir['comments'] . 'comments_' . $_POST['post'] . '.php'); $c_id = trim(file_get_contents($file['id_comments'])); $user = get_values('users', $_SESSION['mn_user_id']); $c_content .= $c_id . DELIMITER . mn_time() . DELIMITER . $_POST['post'] . DELIMITER . '1' . DELIMITER . $_SESSION['mn_user_id'] . DELIMITER . $user['username'] . DELIMITER . $user['email'] . DELIMITER . $user['www'] . DELIMITER . '' . DELIMITER . '' . DELIMITER . '' . DELIMITER . $_SERVER['REMOTE_ADDR'] . DELIMITER . gethostbyaddr($_SERVER['REMOTE_ADDR']) . DELIMITER . $_SERVER['HTTP_USER_AGENT'] . DELIMITER . check_comment_text($_POST['c_text']) . "\n"; if (mn_put_contents($file['id_comments'], $c_id + 1)) { if (mn_put_contents($dir['comments'] . 'comments_' . $_POST['post'] . '.php', $c_content)) { header('location: ./mn-comments.php?back=added'); exit; } else { overall_header($lang['comm_comments'], $lang['comm_msg_put_contents_error'], 'error'); } } else {
} } $mn_info = ''; if (user_auth('1', true) == 1 && isset($p_aprocess) && $p_aprocess > 0) { if ($p_aprocess == 1) { $msg_id = 1; } elseif ($p_aprocess > 1 && $p_aprocess < 5) { $msg_id = 2; } else { $msg_id = 3; } $p_search = array('%n%', '%a%', '%/a%'); $p_replace = array('<strong>' . $p_aprocess . '</strong>', '<a href="./mn-posts.php?s=4&approve">', '</a>'); $mn_info .= '<p><img src="./stuff/img/icons/information.png" alt="(i)" /> ' . str_ireplace($p_search, $p_replace, $lang['index_posts_approve' . $msg_id]) . '</p>'; } if (user_auth('3', true) == 1 && isset($c_aprocess) && $c_aprocess > 0) { if ($c_aprocess == 1) { $msg_id = 1; } elseif ($c_aprocess > 1 && $c_aprocess < 5) { $msg_id = 2; } else { $msg_id = 3; } $c_search = array('%n%', '%a%', '%/a%'); $c_replace = array('<strong>' . $c_aprocess . '</strong>', '<a href="./mn-comments.php?s=2&approve">', '</a>'); $mn_info .= '<p><img src="./stuff/img/icons/information.png" alt="(i)" /> ' . str_ireplace($c_search, $c_replace, $lang['index_comments_approve' . $msg_id]) . '</p>'; } echo !empty($mn_info) ? '<div class="db-info round">' . $mn_info . '</div>' : ''; $server_port = $_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : ''; $url_path = str_ireplace('index.php', '', 'http://' . $_SERVER['SERVER_NAME'] . $server_port . $_SERVER['PHP_SELF']); if (substr($url_path, -1) == '/') {
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('9'); $t_groups = array(); $t_groups = load_basic_data('templates_groups'); // compatibility issue for MNews version 2.2.0 and lower if (!file_exists(MN_ROOT . $dir['templates'] . 'mn_default_19.html')) { mn_put_contents(MN_ROOT . $dir['templates'] . 'mn_default_19.html', $default_template[19]); } if (isset($_GET['action']) && $_GET['action'] == 'add') { $admin_tmpl['tmpl_add_step_1'] = true; $main_types = array(); foreach ($templates as $i) { if (file_exists($dir['templates'] . 'mn_default_' . $i . '.html')) { continue; } else { $main_types[$i] = $lang['tmpl_tmpl_type_' . $i]; } } if (isset($_GET['back']) && $_GET['back'] == 'exists') { overall_header($lang['tmpl_add_template'], $lang['tmpl_msg_tmpl_group_exists'], 'error'); } elseif (isset($_GET['back']) && $_GET['back'] == 'empty') { overall_header($lang['tmpl_add_template'], $lang['tmpl_msg_tmpl_group_empty'], 'error'); } else { overall_header($lang['tmpl_add_template'], $lang['tmpl_add_template'] . ' » ' . $lang['tmpl_step'] . ' 1/3', 'main'); } } elseif (isset($_POST['action']) && $_POST['action'] == 'add' && $_POST['step'] == '1') { if ($_POST['group_mode'] == '1' && $_POST['tmpl_group'] == '0') { $tg_name = 'mn_default'; } elseif ($_POST['group_mode'] == '1' && $_POST['tmpl_group'] != '0') {
<?php include './stuff/inc/mn-start.php'; $auth = user_auth('7'); if (isset($_GET['action']) && $_GET['action'] == 'add') { overall_header($lang['groups_add_new_group'], $lang['groups_add_new_group'], 'main'); $var['permissions'] = '220200000000011'; $admin_tmpl['groups_form'] = true; } elseif (isset($_POST['action']) && $_POST['action'] == 'add') { $permissions = $_POST['dashboard'] . $_POST['posts'] . $_POST['cats'] . $_POST['comments'] . $_POST['pages'] . $_POST['uploads'] . $_POST['users'] . $_POST['groups'] . $_POST['config'] . $_POST['templates'] . $_POST['ipban'] . $_POST['backup'] . $_POST['integration'] . $_POST['help'] . $_POST['profile']; if (strlen($permissions) == 15 && !empty($_POST['group_name'])) { $g_file = file($file['groups']); $g_lines = ''; foreach ($g_file as $single_line) { $g_data = explode(DELIMITER, $single_line); if (substr($g_data[0], 0, 2) == '<?') { $auto_increment_id = trim($g_data[1]); } else { $g_lines .= $single_line; } } $g_content = SAFETY_LINE . DELIMITER . ($auto_increment_id + 1) . "\n" . $g_lines; $g_content .= $auto_increment_id . DELIMITER . check_text($_POST['group_name']) . DELIMITER . friendly_url($_POST['group_name']) . DELIMITER . $permissions . "\n"; if (mn_put_contents($file['groups'], $g_content)) { header('location: ./mn-groups.php?back=added'); exit; } else { overall_header($lang['groups_groups'], $lang['groups_msg_put_contents_error'], 'error'); } } else { overall_header($lang['groups_add_new_group'], $lang['groups_msg_empty_values'], 'error');