From fff1597dd58160b07daa044d68ffee65542c165d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 28 Aug 2012 01:00:59 +0000 Subject: [PATCH] - delete encrypt. --- bin/callback.php | 56 -------------- bin/encryptext.php | 183 --------------------------------------------- bin/mklicense.php | 44 ----------- bin/notice.php | 54 ------------- 4 files changed, 337 deletions(-) delete mode 100644 bin/callback.php delete mode 100644 bin/encryptext.php delete mode 100644 bin/mklicense.php delete mode 100755 bin/notice.php diff --git a/bin/callback.php b/bin/callback.php deleted file mode 100644 index 2e217d952e..0000000000 --- a/bin/callback.php +++ /dev/null @@ -1,56 +0,0 @@ - - - - error - - -

您使用的版本已经过期

-

您当前使用的版本截止日期是{$expiredate},已经过期,请联系我们购买授权。

-

电话:4006 889923

-

QQ:co@zentao.net(1492153927)

-

Email:co@zentao.net

-

网站:http://www.zentao.net

-


-

The edition has been out of date.

-

The edition's end date is $expiredate, has been out of date now, please contact us to renew your license.

-

Email:co@zentao.net

-

网站:http://www.zentao.net/en/

- - - "; - $server = " - - - - error - - -

错误的IP地址或MAC地址

-

软件授权的IP地址或MAC地址和当前系统的IP地址或MAC地址不一致,请使用最初授权的服务器。

-

电话:4006 889923

-

QQ:co@zentao.net(1492153927)

-

Email:co@zentao.net

-

网站:http://www.zentao.net

-


-

Wrong ip address or mac address.

-

The ip or mac address of current server is wrong. Please run zentao on the server we licensed.

-

Email : co@zentao.net

-

Site : http://www.zentao.net/en/

- - - "; - if($err_code == ION_LICENSE_EXPIRED) - { - echo $expired; - } - elseif($err_code == ION_LICENSE_SERVER_INVALID) - { - echo $server; - } - exit; -} diff --git a/bin/encryptext.php b/bin/encryptext.php deleted file mode 100644 index 1c43444db3..0000000000 --- a/bin/encryptext.php +++ /dev/null @@ -1,183 +0,0 @@ -30d year ->365d or 60 -> 60d -$ip = empty($argv[5]) ? '' : $argv[5]; -$mac = empty($argv[6]) ? '' : $argv[6]; -$dirName = basename($filePath); -define('PASSWORD', md5(md5('Zentao Pro editor') . 'cnezsoft')); -echo "Removing file\n"; -`rm -rf /tmp/$dirName`; -echo "Copying file\n"; -`cp -rf $filePath /tmp`; -include dirname(dirname(__FILE__)) . '/framework/control.class.php'; -$filePath = "/tmp/$dirName"; -$defaultValue = ""; -$moduleDir = $filePath . '/module/'; -$modules = glob($moduleDir . '*'); -echo "Seting default value for control\n"; -include 'notice.php'; -foreach($modules as $module) -{ - $controlPath = $module . '/control.php'; - $className = basename($module); - if(file_exists($controlPath)) - { - echo "Seting value for $className\n"; - include $controlPath; - $reflection = new ReflectionClass($className); - if(method_exists($className, '__construct')) - { - $construct = new ReflectionMethod($className, '__construct'); - $fileName = $construct->getFileName(); - $controlContent = file_get_contents($controlPath); - $controlLines = explode("\n", $controlContent); - if($controlPath == $fileName) - { - $endLine = $construct->getEndLine() - 1; - $controlLines[$endLine] = $limitUser . "\n" . $controlLines[$endLine]; - } - else - { - $methods = $reflection->getMethods(); - $startLine = $methods[0]->getStartLine() - 1; - $controlLines[$startLine] = $limitFunc . "\n" . $controlLines[$startLine]; - } - $controlContent = join("\n", $controlLines); - file_put_contents($controlPath, $controlContent); - } - foreach($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) - { - $methodName = strtolower($method->name); - /* This method is not extend from parent */ - if($method->getFileName() != $controlPath) continue; - if($methodName == '__construct') continue; - $params = $method->getParameters(); - foreach($params as $param) - { - $paramName = $param->getName(); - if($param->isDefaultValueAvailable()) $defaultValue .= "\$paramDefaultValue['$className']['$methodName']['$paramName'] = '" . $param->getDefaultValue() . "';\n"; - } - } - } - /* Set ext control default value.*/ - $extControlPath = $module . '/ext/control/'; - if(is_dir($extControlPath)) - { - echo "Seting value for extension of $className\n"; - chdir($extControlPath); - $extControls = glob($extControlPath . '*'); - if(empty($extControls)) continue; - foreach($extControls as $extControl) - { - $methodName = strtolower(substr(basename($extControl), 0, strrpos(basename($extControl), '.'))); - $extFile = file_get_contents($extControl); - $extLines = explode("\n", $extFile); - foreach($extLines as $line) - { - $line = trim($line); - if(preg_match("/^class +($className) +extends +/i", $line, $class) == 1) $extClassName = strtolower($class[1]); - if(preg_match("/^class +(my$className) +extends +/i", $line, $class) == 1) $extClassName = strtolower($class[1]); - if(preg_match("/^(public)?\s+function\s+$methodName/i", $line) == 1) - { - $params = strstr($line, '('); - if(preg_match('/^(.+)$/', $params) == 0) continue; - $params = trim(str_replace(array('(', ')'), '', $params)); - $params = preg_replace('/, *\$/', ',\$', $params); - $params = explode(',$', trim($params, '$')); - foreach($params as $param) - { - if(strpos($param, '=') === false) continue; - $pair = explode('=', $param); - $paramName = trim($pair[0]); - $paramValue = trim(end($pair)); - $defaultValue .= "\$paramDefaultValue['$extClassName']['$methodName']['$paramName'] = $paramValue;\n"; - } - } - } - } - } -} -if($defaultValue) -{ - echo "Writing default value to file\n"; - $valueFile = "account = $company; -$order->users = $users; -$order->ip = $ip; -$order->mac = $mac; -$order->type = $type; -$passphrase = PASSWORD; -createLicense($order, $dirName, '/tmp/'); -$withLicense = "--with-license config/license/" . basename($file) . ".txt --passphrase $passphrase"; -$callback = "--callback-file config/license/callback.php"; - -exec("~/ioncube/ioncube_encoder5 --copy config.php --copy phpexcel/ --copy tmp/ --copy hook/ --copy framework/ --copy config/ --copy view/ --copy lang/ $withLicense $callback --action-if-no-loader \"$noLoader\" $file --update-target --into /tmp/encrypt/", $outError); -foreach($outError as $error) -{ - $errorFile = substr($error, 0 , strpos($error, ':')); - $relativeFile = substr($errorFile, strrpos($errorFile, '/' . basename($file) . '/') + 1) . "\n"; - echo "Copying $errorFile\n"; - `cp $errorFile /tmp/encrypt/$relativeFile`; -} -echo "Ziping extension\n"; -if(file_exists("/tmp/encrypt/$dirName$company.zip")) `rm /tmp/encrypt/$dirName$company.zip`; -`cd /tmp/encrypt/; zip -rm -9 $dirName$company.zip $dirName`; -echo "$dirName$company.zip Finished\n"; - -function createLicense($order, $saveName, $encryptPath) -{ - echo "Creating license.\n"; - if(!is_dir($encryptPath . $saveName))mkdir($encryptPath . $saveName); - if(!is_dir($encryptPath . $saveName . "/config"))mkdir($encryptPath . $saveName . '/config'); - if(!is_dir($encryptPath . $saveName . "/config/license"))mkdir($encryptPath . $saveName . "/config/license"); - - $property = empty($order->account) ? "company='try'" : "company='$order->account'"; - $property .= $order->users == 0 ? '' : ",user=$order->users"; - $property = "--property \"$property\""; - - $server = empty($order->ip) ? '' : '127.0.0.1,' . $order->ip; - $server = !empty($order->mac) ? empty($server) ? "'{{$order->mac}}'" : "'$server{{$order->mac}}'" : $server; - $server = empty($server) ? '' : '--allowed-server ' . $server; - - $expireDays = empty($order->account) ? '186' : ''; - $expireDays = $order->type == 'year' ? "372" : $expireDays; - $expireDays = $order->type == 'try' ? "31" : $expireDays; - $expireDays = is_numeric($order->type) ? "{$order->type}" : $expireDays; - $expireDays = $order->type == 'life' ? "" : $expireDays; - - $expire = empty($expireDays) ? '' : "--expire-in {$expireDays}d"; - $expiredate = empty($expireDays) ? 'All Life' : date('Y-m-d', strtotime("+$expireDays day")); - $callbackFile = dirname(__FILE__) . "/callback.php"; - $callbackCon = file_get_contents($callbackFile); - $callbackCon = str_replace('%expiredate%', $expiredate, $callbackCon); - file_put_contents($encryptPath . "$saveName/config/license/callback.php", $callbackCon); - - $passphrase = PASSWORD; - $license = $encryptPath . $saveName . '/config/license/' . $saveName . '.txt'; - echo `~/ioncube/make_license $property $server $expire --passphrase $passphrase -o $license`; -} diff --git a/bin/mklicense.php b/bin/mklicense.php deleted file mode 100644 index 193a27ba9f..0000000000 --- a/bin/mklicense.php +++ /dev/null @@ -1,44 +0,0 @@ -account = $company; -$order->users = $users; -$order->ip = $ip; -$order->mac = $mac; -$order->type = $type; -createLicense($order, $dirName, '/tmp/encrypt/'); -echo "Ziping extension\n"; -if(file_exists("/tmp/encrypt/license$dirName$company.zip")) `rm /tmp/encrypt/license$dirName$company.zip`; -`cd /tmp/encrypt/; zip -rm -9 license$dirName$company.zip $dirName`; -echo "license$dirName$company.zip Finished\n"; - -function createLicense($order, $saveName, $encryptPath) -{ - echo "Creating license.\n"; - if(!is_dir($encryptPath . $saveName))mkdir($encryptPath . $saveName); - if(!is_dir($encryptPath . $saveName . "/config"))mkdir($encryptPath . $saveName . '/config'); - if(!is_dir($encryptPath . $saveName . "/config/license"))mkdir($encryptPath . $saveName . "/config/license"); - - $property = empty($order->account) ? "company='try'" : "company='$order->account'"; - $property .= $order->users == 0 ? '' : ",user=$order->users"; - $property = "--property \"$property\""; - - $server = empty($order->ip) ? '' : '127.0.0.1,' . $order->ip; - $server = !empty($order->mac) ? empty($server) ? "'{{$order->mac}}'" : "'$server{{$order->mac}}'" : $server; - $server = empty($server) ? '' : '--allowed-server ' . $server; - - $expire = empty($order->account) ? '--expire-in 186d' : ''; - $expire = $order->type == 'year' ? "--expire-in 372d" : $expire; - $expire = $order->type == 'try' ? "--expire-in 31d" : $expire; - - $passphrase = PASSWORD; - $license = $encryptPath . $saveName . '/config/license/' . $saveName . '.txt'; - echo `/usr/local/ioncube/make_license $property $server $expire --passphrase $passphrase -o $license`; -} diff --git a/bin/notice.php b/bin/notice.php deleted file mode 100755 index 143fe3a37a..0000000000 --- a/bin/notice.php +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Error - - -

人数超出限制

-您版本的用户数是{\$properties['user']['value']},您目前系统中已有{\$user->count}人,已经超过了限制,请联系我们增加人数授权。
-email:co@zentao.net
-电话:4006 889923
-网址:www.zentao.net
-


-

Accounts has exceed the limit.

-The accounts has exceed the limit of {\$properties['user']['value']} peoples, please contact us to buy more licenses.
-email:co@zentao.net
-Web:www.zentao.net/en/
- - -EOD; - -$limitUser =<<dao->select("COUNT('*') as count")->from(TABLE_USER)->where('deleted')->eq(0)->fetch(); -if(!empty(\$properties['user']) and \$properties['user']['value'] < \$user->count) die("$notice"); -EOD; - -$limitFunc =<< - - - error - - -

未安装 ioncube loader

-

您需要安装ioncube loader才能使用该功能, 使用ioncube loader安装向导

-


-

Ioncube loader doesn't installed.

-

You haven't installed ioncube loader extension, please visit the install wizard to install it.

- -\\\"; -exit; -";