Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Fix issue #45 https://github.com/iwind/rockmongo/pull/45 #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

.buildpath

.idea

.project

.settings/org.eclipse.php.core.prefs
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,3 @@ public function doChangeLang() {
header("location:index.php");
}
}


?>
4 changes: 1 addition & 3 deletions app/controllers/collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,4 @@ public function doCollectionExport() {
public function doCollectionImport() {
$this->redirect("db.dbImport", array( "db" => xn("db") ));
}
}

?>
}
8 changes: 3 additions & 5 deletions app/controllers/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ public function doDbTransfer() {
//start to transfer
$targetOptions = array();
if ($this->target_auth) {
$targetOptions["username"] = $this->target_username;
$targetOptions["username"] = $this->target_username;
$targetOptions["password"] = $this->target_password;
}
$targetConnection = new RMongo("mongodb://" . $this->target_host . ":" . $this->target_port, $targetOptions);
$targetDb = $targetConnection->selectDB($this->db);
if ($this->target_auth) {
// "authenticate" can only be used between 1.0.1 - 1.2.11
// "authenticate" can only be used between 1.0.1 - 1.2.11
if (RMongo::compareVersion("1.0.1") >= 0 && RMongo::compareVersion("1.2.11") < 0) {
$targetDb->authenticate($this->target_username, $this->target_password);
}
Expand Down Expand Up @@ -497,6 +497,4 @@ public function doDropDatabase() {
$this->ret = $this->_highlight($ret, "json");
$this->display("dropDatabaseResult");
}
}

?>
}
38 changes: 18 additions & 20 deletions app/controllers/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function doNew() {
$dataType = xn("data_type");
$value = xn("value");
$boolValue = xn("bool_value");
$integerValue = xn("integer_value");
$integerValue = xn("integer_value");
$longValue = xn("long_value");
$doubleValue = xn("double_value");
$mixedValue = xn("mixed_value");
Expand All @@ -150,11 +150,11 @@ function doNew() {
$this->_outputJson(array( "code" => 400, "message" => $e->getMessage()));
}

$fieldType = "";
if ($dataType == "integer") {
$fieldType = "integer";
} else if ($dataType == "long") {
$fieldType = "long";
$fieldType = "";
if ($dataType == "integer") {
$fieldType = "integer";
} else if ($dataType == "long") {
$fieldType = "long";
}

if (!$keep) {
Expand Down Expand Up @@ -226,7 +226,7 @@ function doLoad() {
$type = "boolean";
break;
case "integer":
$type = "integer";
$type = "integer";
break;
case "long":
$type = "long";
Expand All @@ -242,11 +242,11 @@ function doLoad() {
$type = "mixed";
break;
case "object":
// int64 is returned as object (Kyryl Bilokurov <[email protected]>)
if (get_class($data) == "MongoInt64") {
$type = "long";
} else {
$type = "mixed";
// int64 is returned as object (Kyryl Bilokurov <[email protected]>)
if (get_class($data) == "MongoInt64") {
$type = "long";
} else {
$type = "mixed";
}
break;
case "resource":
Expand Down Expand Up @@ -284,7 +284,7 @@ function doUpdate() {
$dataType = xn("data_type");
$value = xn("value");
$boolValue = xn("bool_value");
$integerValue = xn("integer_value");
$integerValue = xn("integer_value");
$longValue = xn("long_value");
$doubleValue = xn("double_value");
$mixedValue = xn("mixed_value");
Expand All @@ -304,10 +304,10 @@ function doUpdate() {
}

$fieldType = "";
if ($dataType=="integer") {
$fieldType = "integer";
} else if ($dataType == "long") {
$fieldType = "long";
if ($dataType=="integer") {
$fieldType = "integer";
} else if ($dataType == "long") {
$fieldType = "long";
}
$ret = array();
if ($id) {
Expand Down Expand Up @@ -429,6 +429,4 @@ function doCreateIndex() {
$this->_outputJson(array( "code" => 300, "message" => $ret["err"]));
}
}
}

?>
}
3 changes: 0 additions & 3 deletions app/controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ public function doIndex() {
$this->redirect("admin.index");
}
}


?>
2 changes: 0 additions & 2 deletions app/controllers/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ public function doIndex() {
}
}
}

?>
2 changes: 0 additions & 2 deletions app/controllers/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ function doIndex() {
$this->redirect("login.index");
}
}

?>
4 changes: 1 addition & 3 deletions app/controllers/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ public function doIndex() {

$this->display();
}
}

?>
}
4 changes: 1 addition & 3 deletions app/controllers/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,4 @@ public function doReplication() {

$this->display();
}
}

?>
}
4 changes: 1 addition & 3 deletions app/funcs/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,4 @@ function json_format($json)
}

return $new_json;
}

?>
}
2 changes: 0 additions & 2 deletions app/funcs/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,5 +492,3 @@ function render_server_response($response) {
function render_url($action, array $params = array()) {
echo url($action, $params);
}

?>
4 changes: 1 addition & 3 deletions app/funcs/rock.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,4 @@ function rock_real_value($mongodb, $dataType, $format, $value) {
break;
}
return $realValue;
}

?>
}
2 changes: 0 additions & 2 deletions app/langs/de_de/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,3 @@
$message["loginandrock"] = "Login und abrocken";
$message["changeconfig"] = "Vielleicht möchten Sie ihren Benutzernamen und Passwort in config.php ändern.";
$message["rockmongocredits"] = "Powered by RockMongo v" . (ROCK_MONGO_VERSION) . ", <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">auf neue Version prüfen.</a>";

?>
2 changes: 0 additions & 2 deletions app/langs/en_us/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,3 @@
$message["loginandrock"] = "Login and Rock";
$message["changeconfig"] = "You may change your username and password in config.php.";
$message["rockmongocredits"] = "Powered by <a href=\"http://rockmongo.com\" target=\"_blank\">RockMongo</a> v" . (ROCK_MONGO_VERSION) . ", <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">check out new version here.</a> &nbsp; [<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=iwind%2eliu%40gmail%2ecom&lc=US&amount=10&item_name=RockMongo%20Project%20Donation&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest\">Donate 10 dollars</a>]";

?>
2 changes: 0 additions & 2 deletions app/langs/es_es/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,3 @@
$message["loginandrock"] = "Iniciar sesi&oacute;n and Rock";
$message["changeconfig"] = "Debe cambiar su nombre de usuario y contrase&ntilde;a en el config.php.";
$message["rockmongocredits"] = "Desarrollado por RockMongo v" . (ROCK_MONGO_VERSION) . ", <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">echa un vistazo a la nueva versi&oacute;n aqu&iacute;.</a>";

?>
1 change: 0 additions & 1 deletion app/langs/fr_fr/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,3 @@
$message["changeconfig"] = "Vous devriez changer votre nom d'utilisateur et mot de passe dans le fichier config.php";
$message["rockmongocredits"] = "Powered by RockMongo v" . (ROCK_MONGO_VERSION) . ", <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">check out new version here.</a>";

?>
1 change: 0 additions & 1 deletion app/langs/it_it/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,3 @@
$message["changeconfig"] = "Puoi cambiare la tua username e la password nel file config.php";
$message["rockmongocredits"] = "Powered by RockMongo v" . (ROCK_MONGO_VERSION) . ", <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">verifica nuove versione disponibili.</a>";

?>
2 changes: 0 additions & 2 deletions app/langs/ja_jp/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@
<p>See <a href="http://rockmongo.com" target="_blank">http://rockmongo.com</a> for more details.</p>

<p>If you have any questions, please send email to me: <a href="mailto:[email protected]">[email protected]</a> .</p>';

?>
1 change: 0 additions & 1 deletion app/langs/pt_br/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@

<p>Se vocêem alguma dúvida, me envie um email: <a href="mailto:[email protected]">[email protected]</a> .</p>';

?>
1 change: 0 additions & 1 deletion app/langs/pt_pt/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@

<p>Se têm alguma dúvida, envie um email para: <a href="mailto:[email protected]">[email protected]</a> .</p>';

?>
1 change: 0 additions & 1 deletion app/langs/ru_ru/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,3 @@
$message["changeconfig"] = "Можно изменить имя пользователя и пароль в config.php.";
$message["rockmongocredits"] = "Работает на RockMongo v" . (ROCK_MONGO_VERSION) . ", <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">посмотреть новую версию.</a>";

?>
1 change: 0 additions & 1 deletion app/langs/tr_tr/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,3 @@
$message["changeconfig"] = "Kullanıcı adı ve parolanızı config.php dosyasından değiştirebilirsiniz.";
$message["rockmongocredits"] = "<a href=\"http://rockmongo.com\" target=\"_blank\">RockMongo</a> v" . (ROCK_MONGO_VERSION) . " ile güçlendirilmiştir, <a href=\"http://rockmongo.com/downloads\" target=\"_blank\">yeni sürümü kontrol edin.</a> &nbsp; [<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=iwind%2eliu%40gmail%2ecom&lc=US&amount=10&item_name=RockMongo%20Project%20Donation&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest\">10 Dolar Bağışla</a>]";

?>
2 changes: 0 additions & 2 deletions app/langs/zh_cn/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@
<p>请访问 <a href="http://rockmongo.com" target="_blank">http://rockmongo.com</a> 获取更多信息.</p>

<p>如果有任何问题和反馈,请发送邮件到:<a href="mailto:[email protected]">[email protected]</a> .</p>';

?>
1 change: 0 additions & 1 deletion app/langs/zh_tw/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@

<p>如果有任何問題和反饋,請發送郵件到:<a href="mailto:[email protected]">[email protected]</a> .</p>';

?>
1 change: 0 additions & 1 deletion app/lib/core/REvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ public static function remove($event, $callback) {
}
}

?>
2 changes: 0 additions & 2 deletions app/lib/core/RFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,3 @@ public static function remove($dataType, $filter) {
}
}
}

?>
36 changes: 17 additions & 19 deletions app/lib/core/RPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ public static function load() {
*/
public static function plugins() {
$configPlugins = array();
require(__ROOT__ . DS . "configs" . DS . "rplugin.php");
if (empty($plugins) || !is_array($plugins)) {
return $configPlugins;
}
foreach ($plugins as $name => $plugin) {
$dir = __ROOT__ . DS . "plugins" . DS . $name;
if (!is_dir($dir)) {
$dir = dirname(dirname(__ROOT__)) . DS . "plugins" . DS . $name;
require(__ROOT__ . DS . "configs" . DS . "rplugin.php");
if (empty($plugins) || !is_array($plugins)) {
return $configPlugins;
}
foreach ($plugins as $name => $plugin) {
$dir = __ROOT__ . DS . "plugins" . DS . $name;
if (!is_dir($dir)) {
$dir = dirname(dirname(__ROOT__)) . DS . "plugins" . DS . $name;
}
$pluginConfig = array(
"name" => null,
Expand All @@ -125,7 +125,7 @@ public static function plugins() {
"description" => null,
"version" => null,
"url" => null,
"enabled" => isset($plugin["enabled"]) ? $plugin["enabled"] : false
"enabled" => isset($plugin["enabled"]) ? $plugin["enabled"] : false
);

$descFile = $dir . "/desc.php";
Expand All @@ -134,20 +134,20 @@ public static function plugins() {
if (isset($config["name"])) {
$pluginConfig["name"] = $config["name"];
}
if (isset($config["code"])) {
$pluginConfig["code"] = $config["code"];
if (isset($config["code"])) {
$pluginConfig["code"] = $config["code"];
}
if (isset($config["author"])) {
$pluginConfig["author"] = $config["author"];
if (isset($config["author"])) {
$pluginConfig["author"] = $config["author"];
}
if (isset($config["description"])) {
$pluginConfig["description"] = $config["description"];
if (isset($config["description"])) {
$pluginConfig["description"] = $config["description"];
}
if (isset($config["version"])) {
$pluginConfig["version"] = $config["version"];
}
if (isset($config["url"])) {
$pluginConfig["url"] = $config["url"];
if (isset($config["url"])) {
$pluginConfig["url"] = $config["url"];
}
}

Expand All @@ -157,5 +157,3 @@ public static function plugins() {
return $configPlugins;
}
}

?>
1 change: 0 additions & 1 deletion app/lib/ext/RExtController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ function isAjax() {
}
}

?>
2 changes: 0 additions & 2 deletions app/lib/mime/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,3 @@
"xwd" => "image/x-xwindowdump",
"z" => "application/x-compress",
"zip" => "application/zip");

?>
2 changes: 0 additions & 2 deletions app/lib/mongo/RMongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,5 +290,3 @@ static function lastInsertId() {
return self::$_lastId;
}
}

?>
2 changes: 0 additions & 2 deletions app/lib/mongo/RMongoException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
class RMongoException extends MongoException {

}

?>
1 change: 0 additions & 1 deletion app/lib/mongo/RObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,3 @@ function offsetUnset($index) {
}
}

?>
Loading