Permalink
Browse files

SG

  • Loading branch information...
root
root committed Oct 21, 2018
1 parent 019359e commit f9d13be90d777dc9d18b4a851f70d42533eaa6ab
Showing with 230 additions and 240 deletions.
  1. +7 −11 index.php
  2. +2 −2 nuace.php
  3. +2 −2 nuapi.php
  4. +2 −8 nubuilder-forte.php
  5. +62 −52 nubuilder_session_data.php
  6. +1 −1 nucall.php
  7. +41 −23 nuchoosesetup.php
  8. +8 −8 nucommon.php
  9. +3 −3 nudata.php
  10. +5 −7 nudatabase.php
  11. +2 −2 nudrag.php
  12. +1 −1 nuemailer.php
  13. +6 −8 nuform.php
  14. +6 −13 nupmalogin.php
  15. +62 −59 nuprocesslogins.php
  16. +3 −9 nureportdesigner.php
  17. +1 −4 nurunhtml.php
  18. +0 −4 nurunpdf.php
  19. +1 −1 nusanitize.php
  20. +3 −3 nusession.php
  21. +1 −6 nusystemupdate.php
  22. +11 −13 nuwordpresssetuplibs.php
@@ -1,17 +1,13 @@
<?php
//Sanitize All Input
require_once('nusanitize.php');
nu_sanitize();
require_once('nuchoosesetup.php');
require_once('nuindexlibs.php');
if ( !$_SESSION['nuconfig']->PLUGIN ) {
if ( !$_SESSION['nubuilder_session_data']['PLUGIN'] ) {
require_once('nustandalonesetuplibs.php');
nuStandaloneImportNewDB();
}
if ( $_SESSION['nuconfig']->PLUGIN && !isset($_SESSION['SESSION_ID']) ) {
if ( $_SESSION['nubuilder_session_data']['PLUGIN'] && !isset($_SESSION['nubuilder_session_data']['SESSION_ID']) ) {
require_once('nuwordpresssetuplibs.php');
nuCheckWPUser();
}
@@ -47,7 +43,7 @@ function nuHeader(){
return $j;
}
nuJSIndexInclude($_SESSION['nuconfig']->JQ_PATH);
nuJSIndexInclude($_SESSION['nubuilder_session_data']['JQ_PATH']);
nuJSIndexInclude('nuformclass.js');
nuJSIndexInclude('nuform.js');
@@ -61,7 +57,7 @@ function nuHeader(){
<script>
<?php echo $_SESSION['nuconfig']->PLUGIN ? 'var $ = jQuery;' : ''; ?>
<?php echo $_SESSION['nubuilder_session_data']['PLUGIN'] ? 'var $ = jQuery;' : ''; ?>
function nuValidCaller(o){
@@ -177,18 +173,18 @@ function nuLoginRequest(u, p){
window.nuImages = [];
";
if ( $_SESSION['nuconfig']->PLUGIN ) {
if ( $_SESSION['nubuilder_session_data']['PLUGIN'] ) {
$h1 .= "\nwindow.nuWordpress = true;\n";
} else {
$h1 .= "\nwindow.nuWordpress = false;\n";
}
// Choose h2
if ( $_SESSION['nuconfig']->PLUGIN && isset($_SESSION['SESSION_ID']) ) {
if ( $_SESSION['nubuilder_session_data']['PLUGIN'] && isset($_SESSION['nubuilder_session_data']['SESSION_ID']) ) {
$h2 = nuGetJS_action_screen($nuBrowseFunction, $target, $welcome, $opener, $search, $like);
} else if( $_SESSION['nuconfig']->PLUGIN && !isset($_SESSION['SESSION_ID']) ) {
} else if( $_SESSION['nubuilder_session_data']['PLUGIN'] && !isset($_SESSION['nubuilder_session_data']['SESSION_ID']) ) {
$h2 = nuGetJS_plugin_login($nuBrowseFunction, $target);
@@ -1,6 +1,6 @@
<?php
require_once('nuchoosesetup.php');
$jquery = $_SESSION['nuconfig']->JQ_PATH;
$jquery = $_SESSION['nubuilder_session_data']['JQ_PATH'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
@@ -9,7 +9,7 @@
<script src="<?php echo $jquery; ?>" type="text/javascript"></script>
<?php echo $_SESSION['nuconfig']->PLUGIN ? '<script> var $ = jQuery; </script>' : ''; ?>
<?php echo $_SESSION['nubuilder_session_data']['PLUGIN'] ? '<script> var $ = jQuery; </script>' : ''; ?>
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="ace/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
@@ -27,7 +27,7 @@
$_POST['nuHash']['FORM_ID'] = $F;
$_POST['nuHash']['nuFORMdata'] = json_decode(json_encode($_POST['nuSTATE']['nuFORMdata'])); //-- this holds data from an Edit Form
$_POST['nuHash']['TABLE_ID'] = nuTT();
$_POST['nuHash']['SESSION_ID'] = $_SESSION['SESSION_ID'];
$_POST['nuHash']['SESSION_ID'] = $_SESSION['nubuilder_session_data']['SESSION_ID'];
$_POST['nuValidate'] = array();
$_POST['nuCallback'] = '';
@@ -65,7 +65,7 @@
$f->forms[0]->tableSchema = nuUpdateTableSchema($CT);
$f->forms[0]->viewSchema = nuBuildViewSchema($CT);
$f->forms[0]->formSchema = nuUpdateFormSchema();
$f->forms[0]->session_id = $_SESSION['SESSION_ID'];
$f->forms[0]->session_id = $_SESSION['nubuilder_session_data']['SESSION_ID'];
$f->forms[0]->callback = $_POST['nuCallback'];
$f->forms[0]->errors = $_POST['nuErrors'];
$f->forms[0]->log_again = $_POST['nuLogAgain'];
@@ -27,14 +27,8 @@ function nu_start_session() {
if(!session_id()) {
session_start();
} else {
unset($_SESSION['nuWPSessionData']);
unset($_SESSION['nuconfig']);
unset($_SESSION['nuCheckWPUser']);
unset($_SESSION['SESSION_ID']);
unset($_SESSION['SESSION_TIMESTAMP']);
unset($_SESSION['IsDemo']);
unset($_SESSION['isGlobeadmin']);
unset($_SESSION['translation']);
unset($_SESSION['nubuilder_wordpress_session_data']);
unset($_SESSION['nubuilder_session_data']);
}
}
@@ -2,70 +2,80 @@
class nubuilder_session_data {
var $PLUGIN = false;
var $GLOBEADMIN = false;
var $GLOBEADMIN_NAME = '';
var $GLOBEADMIN_PASS = '';
var $USER_LOGIN = '';
var $USER_PASS = '';
var $USER_EMAIL = '';
var $USER_DISPLAY_NAME = '';
var $USER_ROLES = '';
var $DB_NAME = '';
var $DB_USER = '';
var $DB_PASSWORD = '';
var $DB_HOST = '';
var $DB_CHARSET = '';
var $NU_SITE_URL = '';
var $WP_ADMIN_URL = '';
var $IS_DEMO = false;
var $WP_ROLES = '';
var $WP_SITE_URL = '';
var $JQ_PATH = '';
var $WP_BLOG_CHARSET = 'UTF-8';
var $nubuilder = array(
'PLUGIN' => false,
'GLOBEADMIN' => false,
'GLOBEADMIN_NAME' => '',
'GLOBEADMIN_PASS' => '',
'USER_LOGIN' => '',
'USER_PASS' => '',
'USER_EMAIL' => '',
'USER_DISPLAY_NAME' => '',
'USER_ROLES' => '',
'DB_NAME' => '',
'DB_USER' => '',
'DB_PASSWORD' => '',
'DB_HOST' => '',
'DB_CHARSET' => '',
'NU_SITE_URL' => '',
'WP_ADMIN_URL' => '',
'IS_DEMO' => false,
'WP_ROLES' => '',
'WP_SITE_URL' => '',
'JQ_PATH' => '',
'WP_BLOG_CHARSET' => 'UTF-8',
'SESSION_ID' => null,
'SESSION_TIMESTAMP' => null,
'IsDemo' => null,
'translation' => null);
function __construct() {
}
function get_nubuilder_session_data() {
return $this->nubuilder;
}
function construct_wordpress($wpdata) {
$this->PLUGIN = true;
$this->DB_NAME = $wpdata->DB_NAME;
$this->DB_USER = $wpdata->DB_USER;
$this->DB_PASSWORD = $wpdata->DB_PASSWORD;
$this->DB_HOST = $wpdata->DB_HOST;
$this->DB_CHARSET = $wpdata->DB_CHARSET;
$this->nubuilder['PLUGIN'] = true;
$this->nubuilder['DB_NAME'] = $wpdata->DB_NAME;
$this->nubuilder['DB_USER'] = $wpdata->DB_USER;
$this->nubuilder['DB_PASSWORD'] = $wpdata->DB_PASSWORD;
$this->nubuilder['DB_HOST'] = $wpdata->DB_HOST;
$this->nubuilder['DB_CHARSET'] = $wpdata->DB_CHARSET;
if ( $wpdata->GLOBEADMIN === true ) {
$this->GLOBEADMIN_NAME = $wpdata->USER_LOGIN;
$this->GLOBEADMIN_PASS = $wpdata->USER_PASS;
$this->GLOBEADMIN = true;
$this->nubuilder['GLOBEADMIN_NAME'] = $wpdata->USER_LOGIN;
$this->nubuilder['GLOBEADMIN_PASS'] = $wpdata->USER_PASS;
$this->nubuilder['GLOBEADMIN'] = true;
}
$this->USER_LOGIN = $wpdata->USER_LOGIN;
$this->USER_PASS = $wpdata->USER_PASS;
$this->USER_EMAIL = $wpdata->USER_EMAIL;
$this->USER_DISPLAY_NAME = $wpdata->USER_DISPLAY_NAME;
$this->USER_ROLES = $wpdata->USER_ROLES;
$this->NU_SITE_URL = $wpdata->NU_SITE_URL;
$this->WP_ADMIN_URL = $wpdata->WP_ADMIN_URL;
$this->IS_DEMO = false;
$this->WP_ROLES = $wpdata->WP_ROLES;
$this->WP_SITE_URL = $wpdata->WP_SITE_URL;
$this->JQ_PATH = $this->WP_SITE_URL.'/wp-includes/js/jquery/jquery.js';
$this->WP_BLOG_CHARSET = $wpdata->WP_BLOG_CHARSET;
$this->nubuilder['USER_LOGIN'] = $wpdata->USER_LOGIN;
$this->nubuilder['USER_PASS'] = $wpdata->USER_PASS;
$this->nubuilder['USER_EMAIL'] = $wpdata->USER_EMAIL;
$this->nubuilder['USER_DISPLAY_NAME'] = $wpdata->USER_DISPLAY_NAME;
$this->nubuilder['USER_ROLES'] = $wpdata->USER_ROLES;
$this->nubuilder['NU_SITE_URL'] = $wpdata->NU_SITE_URL;
$this->nubuilder['WP_ADMIN_URL'] = $wpdata->WP_ADMIN_URL;
$this->nubuilder['IS_DEMO'] = false;
$this->nubuilder['WP_ROLES'] = $wpdata->WP_ROLES;
$this->nubuilder['WP_SITE_URL'] = $wpdata->WP_SITE_URL;
$this->nubuilder['JQ_PATH'] = '../../../wp-includes/js/jquery/jquery.js';
$this->nubuilder['WP_BLOG_CHARSET'] = $wpdata->WP_BLOG_CHARSET;
}
function construct_standalone($nuConfigDBHost, $nuConfigDBName, $nuConfigDBUser, $nuConfigDBPassword, $nuConfigDBGlobeadminUsername, $nuConfigDBGlobeadminPassword, $nuConfigIsDemo = false) {
$this->PLUGIN = false;
$this->DB_NAME = $nuConfigDBName;
$this->DB_USER = $nuConfigDBUser;
$this->DB_PASSWORD = $nuConfigDBPassword;
$this->DB_HOST = $nuConfigDBHost;
$this->DB_CHARSET = 'utf8';
$this->GLOBEADMIN_NAME = $nuConfigDBGlobeadminUsername;
$this->GLOBEADMIN_PASS = $nuConfigDBGlobeadminPassword;
$this->IS_DEMO = $nuConfigIsDemo;
$this->JQ_PATH = 'jquery/jquery.js';
$this->nubuilder['PLUGIN'] = false;
$this->nubuilder['DB_NAME'] = $nuConfigDBName;
$this->nubuilder['DB_USER'] = $nuConfigDBUser;
$this->nubuilder['DB_PASSWORD'] = $nuConfigDBPassword;
$this->nubuilder['DB_HOST'] = $nuConfigDBHost;
$this->nubuilder['DB_CHARSET'] = 'utf8';
$this->nubuilder['GLOBEADMIN_NAME'] = $nuConfigDBGlobeadminUsername;
$this->nubuilder['GLOBEADMIN_PASS'] = $nuConfigDBGlobeadminPassword;
$this->nubuilder['IS_DEMO'] = $nuConfigIsDemo;
$this->nubuilder['JQ_PATH'] = 'jquery/jquery.js';
}
}
@@ -29,7 +29,7 @@
if(!array_key_exists('TEMPORARY_SESSION', $_SESSION)){
$getAccessQRY = nuRunQuery("
SELECT * FROM zzzzsys_session WHERE zzzzsys_session_id = ?
", array($_SESSION['SESSION_ID']));
", array($_SESSION['nubuilder_session_data']['SESSION_ID']));
if (db_num_rows($getAccessQRY) != 1) {
header("Content-Type: text/html");
header("HTTP/1.0 400 Bad Request");
@@ -1,39 +1,57 @@
<?php
require_once('nuconfig.php'); // nuconfig must be loaded before using nubuilder_session_data
require_once('nuconfig.php'); // nuconfig must be loaded before using nubuilder_session_dat
require_once('nubuilder_session_data.php');
require_once('nusanitize.php');
if ( !session_id() ) {
// the garbage collector setting
if ( isset($nuConfigTimeOut) ) {
if ( is_int($nuConfigTimeOut) ) {
$gcLifetime = 60 * $nuConfigTimeOut;
ini_set("session.gc_maxlifetime", $gcLifetime);
}
}
nuCheckGarbageCollector();
session_start();
}
if ( !isset($_SESSION['nubuilder_session_data']) ) {
require_once('nubuilder_session_data.php');
nuLoadNewSession();
}
$nubuilder_session_data = new nubuilder_session_data();
//Sanitize All Input
nu_sanitize();
if ( isset($_SESSION['nuWPSessionData']) ) {
// nudatabase will not work without $_SESSION['nubuilder_session_data'] loaded
require_once('nudatabase.php');
$decode = base64_decode($_SESSION['nuWPSessionData']);
$wpdata = json_decode($decode);
$nubuilder_session_data->construct_wordpress($wpdata);
function nuLoadNewSession() {
} else {
nuDieIfWeAreInsideWordpress();
$nubuilder_session_data->construct_standalone($nuConfigDBHost,$nuConfigDBName,$nuConfigDBUser,$nuConfigDBPassword,$nuConfigDBGlobeadminUsername,$nuConfigDBGlobeadminPassword,$nuConfigIsDemo);
}
global $nuConfigDBHost, $nuConfigDBName, $nuConfigDBUser, $nuConfigDBPassword, $nuConfigDBGlobeadminUsername, $nuConfigDBGlobeadminPassword, $nuConfigIsDemo;
$_SESSION['nuconfig'] = $nubuilder_session_data;
$nubuilder_session_data = new nubuilder_session_data();
// nudatabase will not work without $_SESSION['nuconfig'] loaded
require_once('nudatabase.php');
if ( isset($_SESSION['nubuilder_wordpress_session_data']) ) {
$decode = base64_decode($_SESSION['nubuilder_wordpress_session_data']);
$wpdata = json_decode($decode);
$nubuilder_session_data->construct_wordpress($wpdata);
unset($_SESSION['nubuilder_wordpress_session_data']);
} else {
nuDieIfWeAreInsideWordpress();
$nubuilder_session_data->construct_standalone($nuConfigDBHost,$nuConfigDBName,$nuConfigDBUser,$nuConfigDBPassword,$nuConfigDBGlobeadminUsername,$nuConfigDBGlobeadminPassword,$nuConfigIsDemo);
}
$_SESSION['nubuilder_session_data'] = $nubuilder_session_data->get_nubuilder_session_data();
}
function nuCheckGarbageCollector() {
global $nuConfigTimeOut;
if ( isset($nuConfigTimeOut) ) {
if ( is_int($nuConfigTimeOut) ) {
$gcLifetime = 60 * $nuConfigTimeOut;
ini_set("session.gc_maxlifetime", $gcLifetime);
}
}
}
function nuDieIfWeAreInsideWordpress() {
Oops, something went wrong.

0 comments on commit f9d13be

Please sign in to comment.