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

the favicon wasn't showing in my firefox tab and i just add link to it in header.php #94

Open
wants to merge 5 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/config.php
6 changes: 3 additions & 3 deletions app/classes/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function onBefore() {

//if auth is disabled
if ($server && !$server->mongoAuth() && !$server->controlAuth()) {
MUser::login("rockmongo_memo", "rockmongo_memo", xi("host"), "admin", 10800);
MUser::login("rockmongo_memo", "rockmongo_memo", xi("host"), "admin");
$this->_admin = MUser::userInSession();
}
else {
Expand Down Expand Up @@ -139,10 +139,10 @@ protected function _convertValue($mongodb, $dataType, $format, $value, $integerV
case "long":
if (class_exists("MongoInt64")) {
$realValue = new MongoInt64($longValue);
}
}
else {
$realValue = $longValue;
}
}
break;
case "float":
case "double":
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ public function doIndex() {
$this->db = trim(xn("db"));
$this->hostIndex = xi("host");
$this->languages = rock_load_languages();
$this->expires = array(
3 => "3 " . rock_lang("hours"),
720 => "1 " . rock_lang("month"),
);
$this->moreOptions = xi("more");

if ($this->isPost()) {
Expand All @@ -44,7 +40,7 @@ public function doIndex() {

//remember user
import("models.MUser");
MUser::login($this->username, $password, $this->hostIndex, $this->db, xi("expire") * 3600);
MUser::login($this->username, $password, $this->hostIndex, $this->db);

//remember lang
setcookie("ROCK_LANG", x("lang"), time() + 365 * 86400);
Expand Down
8 changes: 1 addition & 7 deletions app/models/MUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class MUser {
private $_password;
private $_hostIndex;
private $_db;
private $_timeout;

public function __construct() {

Expand Down Expand Up @@ -63,10 +62,6 @@ public function dbs() {
return preg_split("/\\s*,\\s*/", $this->_db);
}

public function setTimeout($timeout) {
$this->_timeout = $timeout;
}

/**
* Validate User
*
Expand All @@ -90,14 +85,13 @@ public function changeHost($hostIndex) {
$_SESSION["login"]["index"] = $hostIndex;
}

public static function login($username, $password, $hostIndex, $db, $timeout) {
public static function login($username, $password, $hostIndex, $db) {
$_SESSION["login"] = array(
"username" => $username,
"password" => $password,
"index" => $hostIndex,
"db" => $db
);
setcookie(session_name(), session_id(), time() + $timeout);
}

/**
Expand Down
55 changes: 0 additions & 55 deletions config.php

This file was deleted.

14 changes: 13 additions & 1 deletion config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
* Defining default options and server configuration
* @package rockmongo
*/


// session store configurating

// Timeuot of session in seconds
ini_set('session.gc_maxlifetime', 60*60*3); //3 hours

// this defines, where session files will be stored.
// it is important in this case: http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
$currentSessionPath = ini_get('session.save_path');
$save_path = $currentSessionPath . DIRECTORY_SEPARATOR . 'rockmongo';
if (!is_dir($save_path)) mkdir($save_path, 0777, true);
ini_set('session.save_path', $save_path);

$MONGO = array();
$MONGO["features"]["log_query"] = "on";//log queries
$MONGO["features"]["theme"] = "default";//theme
Expand Down
1 change: 1 addition & 0 deletions themes/default/views/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<script language="javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" src="js/jquery.textarea.js"></script>
<link rel="stylesheet" href="<?php render_theme_path() ?>/css/global.css" type="text/css" media="all"/>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<?php render_page_header(); ?>
<script language="javascript">
$(function () {
Expand Down
10 changes: 0 additions & 10 deletions themes/default/views/login/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@ function r_show_more_options(btn) {
<?php endforeach;?>
</select></td>
</tr>
<tr>
<td><?php hm("alive"); ?>:</td>
<td>
<select name="expire" style="width:150px">
<?php foreach ($expires as $long => $name):?>
<option value="<?php h($long);?>"><?php h($name);?></option>
<?php endforeach;?>
</select>
</td>
</tr>
</tbody>
<tr>
<td colspan="2" align="center"><input type="submit" value="<?php hm("loginandrock"); ?>"/></td>
Expand Down