debug( $_POST, '_POST', __file__, __line__); #$ERR->debug( $_COOKIE, '_COOKIE', __file__, __line__); $submit = $_POST[ 'submit']; $cancel = $_POST[ 'cancel']; if ($submit) { $page = $_POST[ 'page']; $p_user = $_POST[ 'p_user']; if ($page || $user || $p_user) { // if not logged in get posted user info if (!$user) { $user = $_POST[ 'p_user']; //$password = $_POST[ 'p_password']; $conf = new UserConfig( $PIPS_PATH . $user . '.ini'); } // handle and save link $p = new IndexPage( $conf); $p->handle_post(); $close_win = True; } else { // login done $user = $_POST[ 'pagename']; $password = $_POST[ 'password']; $conf = new UserConfig( $PIPS_PATH . $user . '.ini'); if ($password && $password == $conf->user[ 'pass']) { $user_params[ 'p_user'] = $user; $user_params[ 'p_password'] = $password; #$cookie_live = 0; #setcookie( USER_COOKIE, $user, $cookie_live, $COOKIE_PATH, $COOKIE_DOMAIN); #setcookie( PASSWORD_COOKIE.'_'.$user, crypt( $password, substr( $user, -3, 2)), $cookie_live, $COOKIE_PATH, $COOKIE_DOMAIN); } else { $error = make_if_error( sprintf( $TXT_error_login, $user)); $error .= '

' . $TXT_msg_type_error; } } } if ($cancel || $close_win) { $target = get_url( 'local.action.closewindow'); header( "Location: $target"); exit; } // get all users on this pc $pc_users = all_known_users(); // set user & cookie (mem) needed for index.html to save the link if (!$error && !$user) { if (is_array( $pc_users) && count( $pc_users) > 1) { $user = reset( $pc_users); $conf = new UserConfig( $PIPS_PATH . $user . '.ini'); } } ?> Add link to MyPIP set_autoreset(); if ($error) { $tpl->assign( 'error', $error); $tpl->parse( 'content.error'); } $tpl->assign( 'pagename', $user); $tpl->assign( 'url_1', $add_url); $tpl->assign( 'name_1', $add_name); $tpl->parse( 'content'); echo $tpl->text( 'content'); } else { $conf->s9_9[ $add_url] = $add_name; echo edit_link_block( 's9_9', $add_url, "Add link to MyPIP {$user}", True, $user_params, $pc_users, 'local.mypip.addtomypip'); } ?>