Exemple #1
0
 public function edittheme($fname)
 {
     $datafile = $this->input->post('code');
     $path_to_view = get_view_path($fname);
     if (!write_file('' . $path_to_view . '', $datafile)) {
         echo 'Unable to write the file';
     } else {
         $filename = $fname . ".php";
         $data = array("filename" => $filename, "files" => $datafile, "filepath" => $fname);
         $this->load->view('admin-kh4it/theme-editor', $data);
     }
 }
function draw_user_nav_menu()
{
    global $luna_user;
    $items = get_user_nav_menu_items();
    require get_view_path('user-navmenu.php');
}
Exemple #3
0
 public function edittheme($fname)
 {
     $this->load->helper('file');
     $this->load->helper('url');
     $this->load->helper('mygetpath');
     $datafile = $this->input->post('code');
     if ($this->input->post('langfile') != null) {
         $folder = $this->input->post('langfile');
         $path_to_view = get_lang_path($folder, $fname);
     } else {
         $path_to_view = get_view_path($fname);
     }
     if (!write_file('' . $path_to_view . '', $datafile)) {
         echo 'Unable to write the file';
     } else {
         $filename = $fname . ".php";
         $data = array("filename" => $filename, "files" => $datafile, "filepath" => $fname);
         $this->load->view('admin/theme', $data);
     }
 }
Exemple #4
0
        $first_crlf = strpos($mail_tpl, "\n");
        $mail_subject = trim(substr($mail_tpl, 8, $first_crlf - 8));
        $mail_message = trim(substr($mail_tpl, $first_crlf));
        $mail_message = str_replace('<username>', $luna_user['username'], $mail_message);
        $mail_message = str_replace('<base_url>', get_base_url(), $mail_message);
        $mail_message = str_replace('<activation_url>', get_base_url() . '/settings.php?action=change_email&id=' . $id . '&key=' . $new_email_key, $mail_message);
        $mail_message = str_replace('<board_mailer>', $luna_config['o_board_title'], $mail_message);
        luna_mail($new_email, $mail_subject, $mail_message);
        message(__('An email has been sent to the specified address with instructions on how to activate the new email address. If it doesn\'t arrive you can contact the forum administrator at', 'luna') . ' <a href="mailto:' . luna_htmlspecialchars($luna_config['o_admin_email']) . '">' . luna_htmlspecialchars($luna_config['o_admin_email']) . '</a>.', true);
    }
    $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Profile', 'luna'), __('Change email address', 'luna'));
    $required_fields = array('req_new_email' => __('New email', 'luna'), 'req_password' => __('Password', 'luna'));
    $focus_element = array('change_email', 'req_new_email');
    define('FORUM_ACTIVE_PAGE', 'me');
    require load_page('header.php');
    require get_view_path('me-change_email.tpl.php');
} elseif ($action == 'upload_avatar' || $action == 'upload_avatar2') {
    if ($luna_config['o_avatars'] == '0') {
        message(__('The administrator has disabled avatar support.', 'luna'));
    }
    if ($luna_user['id'] != $id && !$luna_user['is_admmod']) {
        message(__('You do not have permission to access this page.', 'luna'), false, '403 Forbidden');
    }
    if (isset($_POST['form_sent'])) {
        if (!isset($_FILES['req_file'])) {
            message(__('You did not select a file for upload.', 'luna'));
        }
        // Make sure they got here from the site
        confirm_referrer('settings.php');
        $uploaded_file = $_FILES['req_file'];
        // Make sure the upload went smooth
Exemple #5
0
function insertView($view_name)
{
    if ($view_name == '' || $view_name == '/') {
        $view_name = 'index';
    } else {
        if (preg_match('/\\/$/', $view_name)) {
            //First try without last slash
            $slash_removed = true;
            $view_name = substr($view_name, 0, strlen($view_name) - 1);
        }
    }
    if (LANG) {
        $path = get_view_path($view_name, LANG);
        if (!file_exists($path)) {
            $path = get_view_path($view_name, null);
        }
    } else {
        $path = get_view_path($view_name, null);
    }
    if (file_exists($path)) {
        include $path;
    } else {
        if (isset($slash_removed)) {
            return insertView($view_name . '/index');
        }
        if ($view_name != 'index') {
            //TODO : redirect to ./..
        }
        return false;
    }
    return true;
}