Menu

#8 Hide whole calendar from anonymous

open
nobody
None
5
2005-07-27
2005-07-27
Anonymous
No

With this option, all users need to be logged in in order
to see anything from the calendar. Anonymous users
see only a thing like "acces for registered only" or
something similar.

Discussion

  • fret

    fret - 2006-02-27

    Logged In: YES
    user_id=1462690

    There are no files!!!!!

    How do we enable this function?

     
  • Nobody/Anonymous

    Logged In: NO

    Here's how to mod extcal2 so that people who are not logged
    in will only see the login prompt, no calendar, and no menu.
    Takes a minute to do, only copy and paste.

    in the theme.php add the following to line 1884

    function loginheader($section = '', $meta = '')
    {
    global $CONFIG, $THEME_DIR;
    global $template_header, $meta_content, $lang_info,
    $lang_general, $lang_system, $upgrade_detected;

    if(empty($section)) $section = $CONFIG['app_name'];

    $template_vars = array(
    '{LANG_DIR}' => $lang_info['direction'],
    '{TITLE}' => $section,
    '{CHARSET}' => $CONFIG['charset'] == 'language-file' ?
    $lang_info['charset'] : $CONFIG['charset'],
    '{META}' => $meta_content . $meta . inline_jscode(),
    '{CAL_NAME}' => $CONFIG['calendar_name'],
    '{CAL_DESCRIPTION}' => $CONFIG['calendar_description'],
    '{MAIN_MENU}' => '',
    '{ADMIN_MENU}' => theme_admin_menu(),
    '{THEME_DIR}' => $THEME_DIR,
    '{MAIN_TABLE_WIDTH}' => $CONFIG['main_table_width']
    );

    echo template_eval($template_header, $template_vars);

    if($upgrade_detected)
    theme_redirect_dialog($lang_system['system_caption'],
    $lang_system['new_upgrade'], $lang_general['continue'],
    "upgrade.php"); // Redirect to this upgrade page

    }

    In the login.php replace line 89 with this:

    loginheader($lang_login_data['section_title']);

    In the calendar.php, insert the following into line 32, also
    insert this into cal_search.php at line 25:

    if(!is_logged_in()) {
    header("location: login.php");
    }

    That's all. Have fun with this otherwise excellent app. New
    version rumored to appear in Q4 of 2006.

    Espy.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.