User Tools

Site Tools


lab:projects:16websem:websem_wiki
  • Change in doku.php. From Line 11 add the following:
if (isset($_COOKIE['HTTP_USER_AGENT'])){
		if ($_COOKIE['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT'])){
			logout();
			exit;
		}
	}
	

	if(!isset($_COOKIE['userid'])){				  			       
		header("Location: https://websem.psychstat.org/login.php");
		exit();		
	}
$_SERVER['REMOTE_USER'] = $_COOKIE['myself'];
$INFO['userinfo']['name']  = $_COOKIE['myself'];
global $USERNAME;
$USERNAME  = $_COOKIE['myself'];
  • In file changelog.php Line 68 & 125
$user   = $_COOKIE['myself'];
  • Change the header
<?php
/**
 * Template header, included in the main and detail files
 */

// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
?>

<!-- ********** HEADER ********** -->
<div id="dokuwiki__header"><div class="pad group">

    <?php tpl_includeFile('header.html') ?>

    <div class="headings group">
        <ul class="a11y skip">
            <li><a href="#dokuwiki__content"><?php echo $lang['skip_to_content']; ?></a></li>
        </ul>

        <h1><?php
            // get logo either out of the template images folder or data/media folder
            $logoSize = array();
            $logo = tpl_getMediaFile(array(':wiki:logo.png', ':logo.png', 'images/logo.png'), false, $logoSize);

            // display logo and wiki title in a link to the home page
            tpl_link(
                wl(),
                '<img src="https://websem.psychstat.org/image/avatar/wiki.png" alt="" />',
                'accesskey="h" title="[H]"'
            );
        ?></h1>
        <?php if ($conf['tagline']): ?>
            <p class="claim"><?php echo $conf['tagline']; ?></p>
        <?php endif ?>
    </div>

    <div class="tools group">
        <!-- USER TOOLS -->
        <?php if ($conf['useacl']): ?>
            <div id="dokuwiki__usertools">
                <h3 class="a11y"><?php echo $lang['user_tools']; ?></h3>
                <ul>
                    <?php
                        if ($_COOKIE['myself']) {
                            echo '<li class="user">Logged in as '.$_COOKIE['myself'].'</li>';
                        }
                        tpl_action('admin', 1, 'li');
                        tpl_action('profile', 1, 'li');
                        if ($_COOKIE['myself']=='johnny') {
                          tpl_action('login', 1, 'li');
                        }
                    ?>
                </ul>
            </div>
        <?php endif ?>

        <!-- SITE TOOLS -->
        <div id="dokuwiki__sitetools">
            <h3 class="a11y"><?php echo $lang['site_tools']; ?></h3>
            <?php tpl_searchform(); ?>
            <div class="mobileTools">
                <?php tpl_actiondropdown($lang['tools']); ?>
            </div>
            <ul>
                <?php
                    tpl_action('recent', 1, 'li');
                    tpl_action('media', 1, 'li');
                    tpl_action('index', 1, 'li');
                ?>
            </ul>
        </div>

    </div>

    <!-- BREADCRUMBS -->
    <?php if($conf['breadcrumbs'] || $conf['youarehere']): ?>
        <div class="breadcrumbs">
            <?php if($conf['youarehere']): ?>
                <div class="youarehere"><?php tpl_youarehere() ?></div>
            <?php endif ?>
            <?php if($conf['breadcrumbs']): ?>
                <div class="trace"><?php tpl_breadcrumbs() ?></div>
            <?php endif ?>
        </div>
    <?php endif ?>

    <?php html_msgarea() ?>

    <hr class="a11y" />
</div></div><!-- /header -->
  • For discussion - action Line 748

Page Tools