Example #1
0
File: Help.php Project: u0mo5/LyFM
 public function main()
 {
     get_lib('LibTemplate')->set_title('帮助文档');
     get_core()->view('header');
     get_core()->view('help');
     get_core()->view('footer');
 }
Example #2
0
 private function auto_login()
 {
     $pass = get_core('LyCookie')->get('LyFileManage');
     if ($pass) {
         $pass = explode("\n", $pass);
         $this->set_password(trim($pass[0]), true);
         if (get_config('password') == $this->password && $_SERVER['HTTP_USER_AGENT'] == trim($pass[1])) {
             $this->is_login = true;
         } else {
             $this->delete_cookie();
         }
     }
 }
Example #3
0
 public function get_s()
 {
     $args = func_get_args();
     $rt = call_user_func_array(array($this, 'get'), $args);
     if (is_array($rt)) {
         foreach ($rt as $id => $v) {
             if (is_array($v)) {
                 get_core('LySafe')->escape_array($rt[$id]);
             } else {
                 $rt[$id] = get_core('LySafe')->escape($rt[$id]);
             }
         }
         return $rt;
     } else {
         return get_core('LySafe')->escape($rt);
     }
 }
Example #4
0
File: Login.php Project: u0mo5/LyFM
 public function post()
 {
     $this->lib->set_password(get_core('LyPost')->get('password'), true);
     if ($this->lib->v()) {
         if (get_core('LyPost')->get('redirect')) {
             redirect(get_core('LyPost')->get('redirect'));
         } else {
             redirect(get_url());
         }
     } else {
         if (get_core('LyPost')->get('redirect')) {
             redirect(get_url('Login?status=error&redirect=' . urlencode(get_core('LyPost')->get('redirect'))));
         } else {
             redirect(get_url('Login?status=error'));
         }
     }
 }
Example #5
0
 public function get_menu()
 {
     $path = array_values(get_core('LyUrl')->get_req_list());
     if (empty($path)) {
         $path = array('/');
     }
     $rt = array();
     $i = 0;
     foreach ($this->menu as $m_id => $v) {
         if (!isset($v['url']) && !isset($v['page'])) {
             unset($this->menu[$m_id]);
             continue;
         }
         $rt[$i]['name'] = $v['name'];
         $rt[$i]['url'] = isset($v['url']) ? $v['url'] : get_url($v['page']);
         $rt[$i]['page_select'] = false;
         $rt[$i]['now_select'] = false;
         $v['page'] = array_values($v['page']);
         $flag = false;
         foreach ($v['page'] as $id => $v2) {
             if (isset($path[$id]) && $v2 == $path[$id]) {
                 $flag = true;
             } else {
                 $flag = false;
                 break;
             }
         }
         if ($flag) {
             $rt[$i]['page_select'] = true;
             if (count($v['page']) == count($path)) {
                 $rt[$i]['now_select'] = true;
             }
         }
         $i++;
     }
     return $rt;
 }
Example #6
0
 public function get_window_dirve()
 {
     $arr = array('status' => false, 'error' => '', 'list' => array());
     if (strtolower(get_core()->get_os()) != 'win') {
         $arr['error'] = '非Window文件系统无法使用该功能';
         return $arr;
     }
     for ($i = ord('A'); $i <= ord('Z'); ++$i) {
         if (is_readable(chr($i) . ":")) {
             array_push($arr['list'], chr($i) . ":");
         }
     }
     $arr['status'] = true;
     return $arr;
 }
Example #7
0
 function __construct()
 {
     $this->core = get_core();
 }
Example #8
0
 public function LIB()
 {
     get_core()->load_lib('LibTemplate');
     return true;
 }
Example #9
0
File: login.php Project: u0mo5/LyFM
?>
" method="post">
<?php 
if (get_core('LyGet')->get('status') == 'error') {
    ?>
	<p class="error">登录失败,密码错误!</p>
<?php 
}
?>
		<label>
			<h2>输入密码:</h2>
			<input class="password" name="password" value="" type="password" />
		</label>
		<button class="submit" type="submit">确认</button>
		<input name="redirect" value="<?php 
echo urldecode(get_core('LyGet')->get('redirect'));
?>
" type="hidden" />
	</form>
</fieldset>
</div>
<script type="text/javascript">
$(document).ready(function(e) {
	$.getScript(FILE_URL+"js/jquery.md5.js");
	$("#login input[name=\"password\"]").focus();
});
$("#login form").submit(function(){
	$("#login form input[name=\"password\"]").val($.md5($("#login form input[name=\"password\"]").val()));
	return true;
});
</script>
Example #10
0
 public function file_size($path)
 {
     //system path
     if (!is_file($path)) {
         return -1;
     }
     $size = @filesize($path);
     if ($size >= 0) {
         return $size;
     }
     if (get_core()->get_os() == 'Win') {
         if (function_exists('exec')) {
             return exec('for %a in ("' . $path . '") do @echo %~za');
         } else {
             return -1;
         }
     } else {
         if (function_exists('exec')) {
             return exec(' ls -l \'' . $path . '\' | awk \'{ print $5 }\'');
         } else {
             return -1;
         }
     }
 }
Example #11
0
 public function is_home()
 {
     return count(get_core('LyUrl')->get_req_list()) == 0;
 }
Example #12
0
function get_config()
{
    $args = func_get_args();
    return call_user_func_array(array(get_core(), 'get_config'), $args);
}
Example #13
0
 private function decode($cookie)
 {
     if ($this->hash) {
         return get_core('LySafe')->decrypt($cookie, $this->hash);
     } else {
         return $cookie;
     }
 }
Example #14
0
File: Api.php Project: u0mo5/LyFM
 public function upload_file()
 {
     //单个文件上传
     $this->out_json($this->file_lib->move_upload_file(get_core('LyPost')->get('path'), isset($_FILES['Filedata']) ? $_FILES['Filedata'] : ""));
 }