~ubuntu-branches/debian/squeeze/movabletype-opensource/squeeze

« back to all changes in this revision

Viewing changes to php/lib/function.mtsignoutlink.php

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves
  • Date: 2008-06-13 23:28:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080613232840-ya4jfxv1jgl45a3d
Tags: 4.2~rc2-1
* New upstream release candidate
* Update Standards-Version (no changes)
* Ensure that schema upgrade message is always seen

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
# Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd.
 
3
# This program is distributed under the terms of the
 
4
# GNU General Public License, version 2.
 
5
#
 
6
# $Id$
 
7
 
 
8
function smarty_function_mtsignoutlink($args, &$ctx) {
 
9
    // status: complete
 
10
    // parameters: none
 
11
    $entry = $ctx->stash('entry');
 
12
    require_once "function.mtcgipath.php";
 
13
    $path = smarty_function_mtcgipath($args, $ctx);
 
14
    if (isset($args['no_static']) && ($args['no_static'] == 1)) {
 
15
        $static_arg = '';
 
16
    } else {
 
17
        $url = $args['static'];
 
18
        if (isset($url) && ($url != '1')) {
 
19
            $static_arg = "&static=" . urlencode($url);
 
20
        } else if (isset($url) && ($url == 1)) {
 
21
            $static_arg = "&static=1";
 
22
        } else {
 
23
            $static_arg = "&static=0";
 
24
        }
 
25
    }
 
26
 
 
27
    $path = $path . $ctx->mt->config('CommentScript') .
 
28
        '?__mode=handle_sign_in' .
 
29
        $static_arg .
 
30
        '&logout=1';
 
31
    if ($entry) {
 
32
        $path .= '&entry_id=' . $entry['entry_id'];
 
33
    }
 
34
    return $path;
 
35
}