Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (114 sloc) 4.28 KB
<?php
/*
Notes by Voltex Pixel
GitHub URL: https://github.com/VoltexPixel/Notes-by-VoltexPixel
Voltex Pixel's Website: http://voltex.upsilos.com/
*/
$vp_operation = true;
include_once('config.php');
$vpg_type = $_GET['type'];
if ($vpg_type == false || '') { $vpg_type = $_POST['type']; }
$vpg_password = $_GET['vpac'];
if ($vpg_password == false || '') { $vpg_password = $_POST['vpac']; }
$vpg_userfile = $_GET['file'];
if ($vpg_userfile == false || '') { $vpg_userfile = $_POST['file']; }
if ($vpg_userfile == false || '') { $vpg_userfile = $vpc_default_file; }
$vp_file_target = '.'.$vpc_directory.'/'.$vpg_userfile.'.'.$vpc_default_format;
if ( is_readable($vp_file_target) ) {
// do nothing
}
else {
echo '<script>alert("404 Not Found ('.$vpg_userfile.')");window.location="'.$vpc_404.'";</script>';
}
$after_edit = $_GET['ae'];
if ($after_edit == false || '') { $after_edit = $_POST['ae']; }
$display_part = 'header';
include('./templates/nbvp-'.$vpc_template.'.php');
if ($vpg_type == 'edit') {
$http_referer_dm = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
$text = file_get_contents($vp_file_target);
$text_textarea = str_ireplace("<br/>", "\r\n", $text);
$text_textarea = str_ireplace("<br />", "", $text_textarea);
if ($vpc_secure == true) {
if ($vpc_secure_login_safe == true) {
if ($http_referer_dm == 'voltex.upsilos.com') {
}
else {
$current_url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$vp_loginpage_data = '?target='.$current_url.'&target_file='.$vpg_userfile;
if ($vpg_password == false) {
echo '<script>window.location="http://voltex.upsilos.com/nbvp-admin.html'.$vp_loginpage_data.'"</script>';
}
else {
echo '<script>alert("Wrong Access.");window.location="http://voltex.upsilos.com/nbvp-admin.html'.$vp_loginpage_data.'"</script>';
}
}
}
if ($vpg_password == $vpc_secure_password) {
// Successfully Logged in!
}
else {
$current_url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$vp_loginpage_data = '?type=login&target='.$current_url.'?type=edit&target_file='.$vpg_userfile;
if ($vpc_secure_login_safe == true) {
$redirect_url = 'http://voltex.upsilos.com/nbvp-admin.html'.$vp_loginpage_data;
}
else {
$redirect_url = 'index.php'.$vp_loginpage_data;
}
if ($vpg_password == false) {
echo '<script>alert("Access Key Required.");window.location="'.$redirect_url.'";</script>';
}
else {
echo '<script>alert("Wrong Password.");window.location="'.$redirect_url.'";</script>';
}
}
}
$display_part = 'edit';
include('./templates/nbvp-'.$vpc_template.'.php');
}
elseif ($vpg_type == 'editing') {
if ($vpc_secure == true) {
if ($vpg_password == $vpc_secure_password) {
}
else {
header('Location: '.$vpc_403);
}
}
$note_dir = $vp_file_target;
if ( is_readable($note_dir) ) {
$note_data = $_GET["vp_filedata"];
if ($note_data == false || '') { $note_data = $_POST["vp_filedata"]; }
if ($vpc_edit_type == 'note') {
$note_data = str_ireplace(array("\r\n","\n","\r"),'<br/>', htmlspecialchars($note_data));
if ($vpc_edit_adddate == true) {
$note_date = date('r');
$note_data_final = 'Latest Update in: '.$note_date.'<br/><br/>'.$note_data;
}
else {
$note_data_final = $note_data;
}
}
elseif ($vpc_edit_type == 'code') {
$note_data_final = $note_data;
}
$note_fp = fopen($note_dir, 'w');
fwrite($note_fp, $note_data_final);
fclose($note_fp);
header('Location: index.php?ae=true&file='.$vpg_userfile);
}
else {
$note_data = $_GET["vp_filedata"];
echo 'Error: File Not Found. <a href="index.php?file='.$note_dir.'">Click here to see the note</a>.';
}
}
elseif ($vpg_type == 'login') {
$display_part = 'edit_login';
include('./templates/nbvp-'.$vpc_template.'.php');
}
else {
$displayed_text = file_get_contents($vp_file_target);
$display_part = 'home';
include('./templates/nbvp-'.$vpc_template.'.php');
}
?>
You can’t perform that action at this time.