foreach ($controls as $c) {
            $ctl = unserialize($c->data);
            $control_type = get_class($ctl);
            $name = $c->name;
            $fields[$name] = call_user_func(array($control_type, 'templateFormat'), $data->{$name}, $ctl);
            $captions[$name] = $c->caption;
        }
        $captions['ip'] = $i18n['ip'];
        $captions['timestamp'] = $i18n['timestamp'];
        $captions['user_id'] = $i18n['username'];
        $fields['ip'] = $data->ip;
        $locUser = exponent_users_getUserById($data->user_id);
        $fields['user_id'] = isset($locUser->username) ? $locUser->username : '';
        $fields['timestamp'] = strftime(DISPLAY_DATETIME_FORMAT, $data->timestamp);
        if ($rpt->text == '') {
            $template = new template('formbuilder', '_default_report');
        } else {
            $template = new template('formbuilder', '_custom_report');
            $template->assign('template', $rpt->text);
        }
        $template->assign('fields', $fields);
        $template->assign('captions', $captions);
        $template->assign('backlink', exponent_flow_get());
        $template->assign('is_email', 0);
        $template->output();
    } else {
        echo SITE_403_HTML;
    }
} else {
    echo SITE_404_HTML;
}
            //This is an easy way to remove duplicates
            $emaillist = array_flip(array_flip($emaillist));
            if (count($emaillist)) {
                //This is an easy way to remove duplicates
                $emaillist = array_flip(array_flip($emaillist));
                if (!defined("SYS_SMTP")) {
                    include_once BASE . "subsystems/smtp.php";
                }
                $headers = array("MIME-Version" => "1.0", "Content-type" => "text/html; charset=iso-8859-1");
                if (exponent_smtp_mail($emaillist, "", $f->subject, $emailHtml, $headers) == false) {
                    $i18n = exponent_lang_loadFile('modules/formbuilder/actions/submit_form.php');
                    echo $i18n['err_smtp'];
                }
            }
        }
        //If is a new post show response, otherwise redirect to the flow.
        if (!isset($_POST['data_id'])) {
            $template = new template("formbuilder", "_view_response");
            global $SYS_FLOW_REDIRECTIONPATH;
            $SYS_FLOW_REDIRECTIONPATH = "editfallback";
            $template->assign("backlink", exponent_flow_get());
            $SYS_FLOW_REDIRECTIONPATH = "exponent_default";
            $template->assign("response_html", $f->response);
            $template->output();
        } else {
            exponent_flow_redirect();
        }
    } else {
        echo SITE_403_HTML;
    }
}
    $template = new template('AdministrationModule', '_upload_finalSummary', $loc);
    $ext_filename = BASE . "/tmp/uploads/" . session_id();
    if (!file_exists($ext_filename) || !is_dir($ext_filename)) {
        $template->assign('nofiles', 1);
    } else {
        if (!defined('SYS_FILES')) {
            require_once BASE . 'subsystems/files.php';
        }
        $success = array();
        foreach (array_keys(exponent_files_listFlat($ext_filename, true, null, array(), $ext_filename)) as $file) {
            if ($file != '/archive.tar' && $file != '/archive.tar.gz' && $file != 'archive.tar.bz2' && $file != '/archive.zip') {
                exponent_files_makeDirectory(dirname($file));
                $success[$file] = copy($ext_filename . $file, BASE . substr($file, 1));
                if (basename($file) == 'views_c') {
                    chmod(BASE . substr($file, 1), 0777);
                }
            }
        }
        $del_return = exponent_files_removeDirectory($ext_filename);
        echo $del_return;
        $template->assign('nofiles', 0);
        $template->assign('success', $success);
        $template->assign('redirect', exponent_flow_get());
        ob_start();
        include BASE . 'modules/AdministrationModule/actions/installtables.php';
        ob_end_clean();
    }
    $template->output();
} else {
    echo SITE_403_HTML;
}
 function standalonetemplate($view)
 {
     include_once BASE . 'external/Smarty/libs/Smarty.class.php';
     $this->tpl = new Smarty();
     //$this->tpl->security = true;
     $this->tpl->php_handling = SMARTY_PHP_REMOVE;
     $this->tpl->plugins_dir[] = BASE . 'subsystems/template/Smarty/plugins';
     $file = exponent_template_getViewFile("", "", $view);
     $this->view = substr(basename($file), 0, -4);
     $this->viewdir = str_replace(BASE, '', realpath(dirname($file)));
     $this->tpl->template_dir = $this->viewdir;
     // Make way for i18n
     // $this->tpl->compile_dir = $this->viewdir."_c";
     $this->tpl->compile_dir = BASE . '/tmp/views_c';
     $this->tpl->compile_id = md5($this->viewfile);
     $this->tpl->assign("__view", $view);
     $this->tpl->assign("__redirect", exponent_flow_get());
 }
 function controlToHTML($name)
 {
     if ($this->submit . $this->reset . $this->cancel == "") {
         return "";
     }
     $html = "";
     if ($this->submit != "") {
         $html .= '<input type="submit" value="' . $this->submit . '"';
         if ($this->disabled) {
             $html .= " disabled";
         }
         $html .= ' onClick="if (checkRequired(this.form)) ';
         if ($this->validateJS != "") {
             $html .= '{ if (' . $this->validateJS . ') { return true; } else { return false; } }';
         } else {
             $html .= '{ return true; }';
         }
         $html .= ' else { return false; }"';
         $html .= ' />';
     }
     if ($this->reset != "") {
         $html .= '<input type="reset" value="' . $this->reset . '"' . ($this->disabled ? " disabled" : "") . ' />';
     }
     if ($this->cancel != "") {
         $html .= '<input type="button" value="' . $this->cancel . '"';
         $html .= ' onClick="document.location.href=\'' . exponent_flow_get() . '\'"';
         $html .= ' />';
     }
     return $html;
 }
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined("EXPONENT")) {
    exit("");
}
// Sanitize required _GET parameters
$_GET['id'] = intval($_GET['id']);
$_GET['datatype'] = preg_replace('/[^A-Za-z0-9_]/', '', $_GET['datatype']);
$object = $db->selectObject($_GET['datatype'] . "_wf_revision", "id=" . $_GET['id']);
$rloc = unserialize($object->location_data);
if (exponent_permissions_check("manage_approval", $rloc)) {
    // We need the module, in order to render the view correctly.
    $oloc = unserialize($object->location_data);
    $module = $oloc->mod;
    $template = new template($module, "_workflowview", $loc);
    $template->assign("item", $object);
    $view = $template->render();
    $t = new template("workflow", "_viewrevision", $loc);
    $t->assign("view", $view);
    $t->assign("back", exponent_flow_get());
    $t->assign("revision", $object);
    $t->output();
} else {
    echo SITE_403_HTML;
}
<?php

##################################################
#
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
// GREP:HARDCODEDTEXT
if (!defined("EXPONENT")) {
    exit("");
}
echo '<a class="mngmntlink workflow_mngmntlink" href="';
echo exponent_flow_get();
echo '">Back</a> to approval manager.';