Skip to content
Permalink
Browse files

Fixed install error

  • Loading branch information...
Ayoola FALOLA
Ayoola FALOLA committed Feb 25, 2019
1 parent dd0baf0 commit a4bec36b3d1a185b78951043d6358899035ac4da
@@ -7,7 +7,7 @@
},
{
"order":"1",
"uri":"pagecarton/plugin/index.php",
"uri":"pagecarton/frontend/index.php",
"icon":"pagecarton.png",
"group_id":"software",
"type":"link",
@@ -18,7 +18,7 @@
},
{
"order":"1",
"uri":"pagecarton/plugin/create.php",
"uri":"pagecarton/frontend/create.php",
"icon":"pagecarton-creator.png",
"group_id":"pagecarton",
"type":"link",
@@ -29,7 +29,7 @@
},
{
"order":"2",
"uri":"pagecarton/plugin/post.php",
"uri":"pagecarton/frontend/post.php",
"icon":"pagecarton-post.png",
"group_id":"pagecarton",
"type":"link",
@@ -42,7 +42,7 @@
"order":"3",
"type":"link",
"group_id":"pagecarton",
"uri":"pagecarton/plugin/manage.php",
"uri":"pagecarton/frontend/manage.php",
"icon":"pagecarton-sites.png",
"target":"_blank",
"featuremanager":true,
@@ -1,11 +1,15 @@
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
if( ! is_dir( $_SERVER['HOME'] . '/pagecarton/core/' ) )
{
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/plugin/pc_install.php' );
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/frontend/pc_installer.php' );
// exit();
}
}
$username = $_SERVER['USER'];
$ip = $_SERVER['SERVER_NAME'];
$homeUrl = 'http://' . $ip . '/~' . $username;
@@ -15,14 +19,46 @@
$autoAuthId = md5( $username . $_SERVER['SERVER_ADDR'] . $_SERVER['SERVER_NAME'] . $_SERVER['REMOTE_PORT'] . $_SERVER['cp_security_token'] . time() . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_COOKIE'] );
$autoAuthFile = '/home/' . $username . '/pagecarton/sites/default/application/auto-auth/' . $autoAuthId;
mkdir( dirname( $autoAuthFile ), 0777, true );
if( ! is_dir( dirname( $autoAuthFile ) ) )
{
mkdir( dirname( $autoAuthFile ), 0777, true );
chmod( '/home/' . $username . '/pagecarton', 0644 );
chown( '/home/' . $username . '/pagecarton', $username );
chgrp( '/home/' . $username . '/pagecarton', $username );
chmod( '/home/' . $username . '/pagecarton/sites', 0644 );
chown( '/home/' . $username . '/pagecarton/sites', $username );
chgrp( '/home/' . $username . '/pagecarton/sites', $username );
chmod( '/home/' . $username . '/pagecarton/sites/default', 0644 );
chown( '/home/' . $username . '/pagecarton/sites/default', $username );
chgrp( '/home/' . $username . '/pagecarton/sites/default', $username );
chmod( '/home/' . $username . '/pagecarton/sites/default/application', 0644 );
chown( '/home/' . $username . '/pagecarton/sites/default/application', $username );
chgrp( '/home/' . $username . '/pagecarton/sites/default/application', $username );
chmod( '/home/' . $username . '/pagecarton/sites/default/application', 0644 );
chown( '/home/' . $username . '/pagecarton/sites/default/application', $username );
chgrp( '/home/' . $username . '/pagecarton/sites/default/application', $username );
chmod( '/home/' . $username . '/pagecarton/sites/default/application/auto-auth', 0644 );
chown( '/home/' . $username . '/pagecarton/sites/default/application/auto-auth', $username );
chgrp( '/home/' . $username . '/pagecarton/sites/default/application/auto-auth', $username );
}
$authInfo = array(
'username' => $_SERVER['USER'],
// 'password' => $_SERVER['REMOTE_PASSWORD'],
'email' => $_SERVER['USER'] . '@' . $_SERVER['SERVER_NAME'],
'access_level' => 99,
);
file_put_contents( $autoAuthFile, json_encode( $authInfo ) );
chmod( $autoAuthFile, 0644 );
chown( $autoAuthFile, $username );
chgrp( $autoAuthFile, $username );
defined( 'PC_AUTO_AUTH_TOKEN' ) || define( 'PC_AUTO_AUTH_TOKEN', $autoAuthId );
@@ -1,6 +1,6 @@
<?php
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/plugin/check_install.php' );
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/frontend/check_install.php' );
$username = $_SERVER['USER'];
$ip = $_SERVER['SERVER_NAME'];
@@ -1,7 +1,7 @@
<?php
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/plugin/check_install.php' );
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/frontend/check_install.php' );
$username = $_SERVER['USER'];
@@ -1,6 +1,6 @@
<?php
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/plugin/check_install.php' );
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/frontend/check_install.php' );
$username = $_SERVER['USER'];
@@ -17,10 +17,10 @@
}
}
$header = 'From: info@pagecarton.com' . "\r\n";
/* $header = 'From: info@pagecarton.com' . "\r\n";
$header .= "Return-Path: " . @$mailInfo['return-path'] ? : $mailInfo['from'] . "\r\n";
mail( 'info@pagecarton.com', 'New PageCarton Installed on cPanel', var_export( $input, true ), $header );
*/
$username = $_SERVER['USER'];
$installer = '/home/' . $username . '/public_html/pc_installer.php';
@@ -1,6 +1,6 @@
<?php
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/plugin/check_install.php' );
require_once( '/usr/local/cpanel/3rdparty/bin/pagecarton/frontend/check_install.php' );
$username = $_SERVER['USER'];
$ip = $_SERVER['SERVER_NAME'];
@@ -7,7 +7,7 @@ fi

FRONTEND_BASE="/usr/local/cpanel/base/frontend/$THEMENAME/pagecarton"
PAGECARTON_BASE="/usr/local/cpanel/3rdparty/bin/pagecarton"
PLUGIN_BASE="$PAGECARTON_BASE/plugin"
PLUGIN_BASE="$PAGECARTON_BASE/frontend"

# remove previous
rm -rf pagecarton-cpanel-plugin
@@ -20,20 +20,21 @@ mkdir -p "$PLUGIN_BASE"
# download plugin
git clone https://github.com/pagecarton/pagecarton-cpanel-plugin.git

# copy frontend
cp -r pagecarton-cpanel-plugin/frontend/* "$PLUGIN_BASE"
ln -s "$PLUGIN_BASE" "$FRONTEND_BASE"

# DUMP everything
cp -r pagecarton-cpanel-plugin/* "$PAGECARTON_BASE"

# copy frontend
#cp -r pagecarton-cpanel-plugin/frontend/* "$PLUGIN_BASE"
ln -s "$PLUGIN_BASE" "$FRONTEND_BASE"

# new accounts
INSTALL_FILENAME="pagecarton-cpanel-plugin/new-account-auto-install.sh"
chmod 755 $INSTALL_FILENAME
$INSTALL_FILENAME

# uninstall
/usr/local/cpanel/scripts/uninstall_plugin pagecarton-cpanel-plugin/configuration --theme="$THEMENAME"
/usr/local/cpanel/scripts/uninstall_plugin /usr/local/cpanel/3rdparty/bin/pagecarton/configuration --theme="$THEMENAME"

/usr/local/cpanel/scripts/install_plugin pagecarton-cpanel-plugin/configuration --theme "$THEMENAME"
/usr/local/cpanel/scripts/install_plugin /usr/local/cpanel/3rdparty/bin/pagecarton/configuration --theme "$THEMENAME"

@@ -69,12 +69,20 @@ function add() {
$remoteSite = $remoteSite3;
}
}
$ip = gethostname();
$username = $input['data']['user'];
$homeUrl = 'http://' . $ip . '/~' . $username;
$buildSiteLink = '/widgets/PageCarton_NewSiteWizard';
$installer = '/home/' . $username . '/public_html/pc_installer.php';
$pcCheckFile = '/home/' . $username . '/public_html/pc_check.txt';
file_put_contents( $pcCheckFile, 'pc' );
if( 'pc' == fetchLink( $input['data']['domain'] . '/' . basename( $pcCheckFile ) ) )
{
$homeUrl = 'http://' . $input['data']['domain'];
}
if( $f = fetchLink( $remoteSite . '/pc_installer.php?do_not_highlight_file=1' ) )
{

0 comments on commit a4bec36

Please sign in to comment.
You can’t perform that action at this time.