+++ /dev/null
-<?php
-
- class mw_env_webmaster extends mw_env{
-
- function load_webmaster_session(){
- $data = $this->data();
- if(!($webmaster_user = $this->get_webmaster_user())) return array();
- return $data->load_session($webmaster_user);
- }
-
- function get_webmaster_user(){
- if(!file_exists($this->get_webmaster_user_file())) return array();
- if(!($content = @file_get_contents($this->get_webmaster_user_file()))) return false;
- $v_content = explode(":", $content);
- if(count($v_content) != 2) return false;
- return array(
- "login" => trim($v_content[0]),
- "password" => trim($v_content[1])
- );
- }
-
- function set_webmaster_user($login, $password){
- return @file_put_contents($this->get_webmaster_user_file(), $login.":".$password);
- }
-
- function get_webmaster_user_file(){
- return $this->path("content")."data/.webmaster";
- }
-
- function webmaster_login($login, $password){
- $data = $this->data();
- if(!($webmaster_user = $this->get_webmaster_user())){
- return false;
- }
- return $data->login($login, $password, $webmaster_user);
- }
-
- }