Example #1
0
function select_profile($cmd)
{
    // Request for a random profile.
    //
    if ($cmd == "rand") {
        $profiles = array();
        $pic = get_int('pic');
        if ($pic == 0) {
            $profiles = BoincProfile::enum("has_picture=0", "limit 1000");
        } else {
            if ($pic == 1) {
                $profiles = BoincProfile::enum("has_picture=1", "limit 1000");
            } else {
                if ($pic == -1) {
                    $profiles = BoincProfile::enum(null, "limit 1000");
                }
            }
        }
        if (count($profiles) == 0) {
            page_head(tra("No profiles"));
            echo tra("No profiles matched your query.");
            page_tail();
            exit;
        }
        shuffle($profiles);
        $userid = $profiles[0]->userid;
        header("Location: " . url_base() . "view_profile.php?userid={$userid}");
        exit;
    }
}
Example #2
0
function url_next_post($params = '')
{
    $post_number_to_display = get_stored_parameter('post_number_to_display');
    $num_posts_available = get_stored_parameter('num_posts_available');
    $url = url_base() . '?post_number=';
    if ($post_number_to_display >= $num_posts_available) {
        // indicate to the view that there is not a next post
        return '';
    } else {
        return $url . ($post_number_to_display + 1);
    }
}
Example #3
0
function show_form()
{
    start_table();
    table_header("ID", "name", "title", "image URL", "type<br><p class=\"text-muted\">0=user<br>1=team<br>optional</p>", "description<br><p class=\"text-muted\">optional</p>", "level<br><p class=\"text-muted\">optional</p>", "tags<br><p class=\"text-muted\">optional</p>", "SQL rule<br><p class=\"text-muted\">optional</p>", "", "");
    $badges = BoincBadge::enum("");
    $i = 0;
    foreach ($badges as $badge) {
        echo "<tr class=row{$i} valign=top><form action=badge_admin.php method=POST>";
        $i = 1 - $i;
        echo "<td>{$badge->id}</td>\n";
        echo "<input type=hidden name=id value={$badge->id}>";
        $nu = BoincBadgeUser::count("badge_id={$badge->id}");
        $nt = BoincBadgeTeam::count("badge_id={$badge->id}");
        $x = "<br><p class=\"text-muted\">Assigned to {$nu} users<br>Assigned to {$nt} teams</p>";
        echo "<td><input name=\"name\" value=\"{$badge->name}\">{$x}</td>\n";
        echo "<td><input name=\"title\" value=\"{$badge->title}\"></td>\n";
        $x = "";
        if ($badge->image_url) {
            if (strstr($badge->image_url, "http") == $badge->image_url) {
                $y = $badge->image_url;
            } else {
                $y = url_base() . $badge->image_url;
            }
            $x = " <img align=right height=64 src=\"{$y}\">";
        }
        echo "<td><input name=\"image_url\" value=\"{$badge->image_url}\">{$x}</td>\n";
        echo "<td><input name=\"type\" size=4 value=\"{$badge->type}\"></td>\n";
        echo "<td><input name=\"description\" value=\"{$badge->description}\"></td>\n";
        echo "<td><input name=\"level\" value=\"{$badge->level}\"></td>\n";
        echo "<td><input name=\"tags\" value=\"{$badge->tags}\"></td>\n";
        echo "<td><input name=\"sql_rule\" value=\"{$badge->sql_rule}\"></td>\n";
        echo "<td><input class=\"btn btn-default\" type=submit name=\"update\" value=Update>\n";
        echo "<td><input class=\"btn btn-danger\" type=submit name=\"delete\" value=Delete>\n";
        echo "</form></tr>\n";
    }
    echo "<tr><form action=badge_admin.php method=POST>";
    echo "<td><br></td>\n";
    echo "<td><input name=\"name\"></td>\n";
    echo "<td><input name=\"title\"></td>\n";
    echo "<td><input name=\"image_url\"></td>\n";
    echo "<td><input name=\"type\" size=4></td>\n";
    echo "<td><input name=\"description\"></td>\n";
    echo "<td><input name=\"level\"></td>\n";
    echo "<td><input name=\"tags\"></td>\n";
    echo "<td><input name=\"sql_rule\"></td>\n";
    echo "<td colspan=2><input class=\"btn btn-primary\" type=submit name=\"add_badge\" value=\"Create badge\"></td>\n";
    echo "</form></tr>\n";
    end_table();
}
Example #4
0
function drawNavigationRow($pages, $module = false, $pq = false)
{
    global $_josh;
    $count = count($pages);
    if ($count < 2) {
        return false;
    }
    $return = '<table class="navigation" cellspacing="1">
		<tr class="hilite">';
    $cellwidth = round(100 / $count, 2);
    $match = $pq ? $_josh["request"]["path_query"] : $_josh["request"]["path"];
    //echo $match;  don't put url_base in match, if you can help it
    foreach ($pages as $url => $name) {
        if ($url == $match || $url == url_base() . $match) {
            $cell = ' class="selected">' . $name . '';
        } else {
            $cell = '><a href="' . $url . '">' . $name . '</a>';
        }
        $return .= '<td width="' . $cellwidth . '%"' . $cell . '</td>';
    }
    return $return . '</tr>
		</table>';
}
Example #5
0
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
// Redirect user to PayPal system
require_once "../inc/util.inc";
db_init();
$logged_in_user = get_logged_in_user(false);
$amount = post_str("inV");
$item_id = post_int("item_id", true);
if ($item_id == null) {
    $item_id = 1;
}
$currency = post_str("currency");
if (post_int("anonymous", true) == 1 || $logged_in_user == null) {
    $userid = 0;
} else {
    $userid = $logged_in_user->id;
}
$order_time = time();
// Write user id to paypal table, so the return script knows it's expecting this payment
_mysql_query("INSERT INTO donation_paypal SET order_time = '" . $order_time . "', userid = '{$userid}', item_number=" . $item_id . ", order_amount = '" . boinc_real_escape_string($amount) . "'");
$payment_id = _mysql_insert_id();
$URL = "www.paypal.com/cgi-bin/webscr";
$fields = "cmd=_xclick&lc=US&business=" . PAYPAL_ADDRESS . "&quantity=1&item_name=Donation&item_number=" . $payment_id . "_" . $order_time . "&amount=" . $amount . "&no_shipping=1&return=" . url_base() . "donated.php?st=Completed&rm=2&cancel_return=" . url_base() . "/donated.php&no_note=1&currency_code=" . $currency . "&bn=PP-BuyNowBF";
header("Location: https://{$URL}?{$fields}");
exit;
Example #6
0
        $thread = BoincThread::lookup_id($post->thread);
        if (!$thread) {
            continue;
        }
        $forum = BoincForum::lookup_id($thread->forum);
        if (!$forum) {
            continue;
        }
        if (!is_forum_visible_to_user($forum, $logged_in_user)) {
            continue;
        }
        if (!$show_hidden_posts) {
            if ($thread->hidden) {
                continue;
            }
            if ($post->hidden) {
                continue;
            }
        }
        show_post_and_context($post, $thread, $forum, $options, $n);
        $n++;
    }
    end_table();
}
if (!count($threads) && !count($posts)) {
    echo "<p>" . tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).") . "</p>\n    <p>" . tra("You can also %1try the same search on Google.%2", "<a href=\"http://www.google.com/search?domains=" . url_base() . "&sitesearch=" . url_base() . "forum_thread.php&q=" . htmlentities($search_keywords) . "\">", "</a>") . "</p>";
}
echo "<p><a href=\"forum_search.php\">" . tra("Perform another search") . "</a></p>";
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
Example #7
0
function emailPassword($user_id)
{
    $user = db_grab('SELECT u.email, l.code language FROM users u JOIN languages l ON u.language_id = l.id WHERE u.is_active = 1 AND u.id = ' . $user_id);
    $message = getString('email_password_message', $user['language']);
    $message = str_replace('%LINK%', url_base() . '/login/password_reset.php?id=' . $user_id, $message);
    emailUser($user['email'], getString('email_password_subject', $user['language']), $message);
}
Example #8
0
<?php

session_start();
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "../";
define("RAIZ", $dir);
include_once RAIZ . "configuracion.php";
if (!(isset($_SESSION["LoginSistema"]) && $_SESSION['LoginSistema'] == 1)) {
    include_once RAIZ . "funciones/url.php";
    header("Location:" . url_base() . $directory . "login/?u=" . $_SERVER['PHP_SELF']);
} else {
    include_once RAIZ . "funciones/funciones.php";
}
Example #9
0
		
	</ul>
	
	<div class="r_b">
        <?php 
if (defined('__SAMSONCMS_LOGO')) {
    ?>
		    <div class="logo"></div>
        <?php 
}
?>
        <?php 
m('i18n')->render('list');
?>
		<a href="<?php 
url_base('signin', 'logout');
?>
" class="logout" title="<?php 
t('Выход');
?>
">.</a>
	</div>
</nav>

<div class="sub_menu_wrapper <?php 
isv('submenu', 'control');
?>
">
	<?php 
if (isv('submenu')) {
    ?>
Example #10
0
<?php

session_start();
include_once "../configuracion.php";
include_once "../funciones/url.php";
foreach ($_SESSION as $k => $v) {
    //	echo $k."-".$v;
    unset($_SESSION[$k]);
}
unset($_SESSION["Login"]);
unset($_SESSION["CodUsuarioLog"]);
unset($_SESSION["Nivel"]);
unset($_SESSION["LoginSistemaContable"]);
unset($_SESSION["CodEmpresa"]);
session_destroy();
header("Location:" . url_base() . $directory);
Example #11
0
<?php

include '../include.php';
if (url_action('delete')) {
    if (!isset($_GET['delete_id']) && isset($_GET['id'])) {
        $_GET['delete_id'] = $_GET['id'];
    }
    $r = db_grab('SELECT firstname, lastname, endDate FROM users WHERE id = ' . $_GET['delete_id']);
    if ($r['endDate']) {
        db_query('UPDATE users SET is_active = 0, deleted_user = '******'user_id'] . ', deleted_date = GETDATE() WHERE id = ' . $_GET['delete_id']);
    } else {
        db_query('UPDATE users SET is_active = 0, deleted_user = '******'user_id'] . ', deleted_date = GETDATE(), endDate = GETDATE() WHERE id = ' . $_GET['delete_id']);
    }
    if (getOption('staff_alertdelete')) {
        emailAdmins('Intranet: Staff Deleted', draw_link(url_base() . '/staff/view.php?id=' . $_GET['staffID'], $r['firstname'] . ' ' . $r['lastname']) . ' was just deactivated on the Intranet.');
    }
    url_query_drop('action,delete_id');
}
function drawJumpToStaff($selectedID = false)
{
    global $page;
    $nullable = $selectedID === false;
    $return = drawPanel(getString('jump_to') . ' ' . drawSelectUser('', $selectedID, $nullable, 0, true, true, 'Staff Member:'));
    if ($page['is_admin'] && db_grab('SELECT COUNT(*) FROM users_requests WHERE is_active = 1')) {
        $return = drawMessage('There are pending <a href="requests.php">account requests</a> for you to review.') . $return;
    }
    return $return;
}
Example #12
0
<?php

include '../include.php';
$result = db_table('SELECT
	u.id link,
	u.firstname,
	u.lastname,
	u.title,
	d.departmentName department,
	o.title organization,
	u.email,
	(SELECT CASE WHEN u.rankID = 9 THEN "No" ELSE "Yes" END) is_staff
	FROM users u
	LEFT JOIN departments d ON u.departmentID = d.departmentID
	JOIN organizations o ON u.organization_id = o.id
	WHERE u.is_active = 1
	ORDER BY u.lastname, u.firstname');
foreach ($result as &$r) {
    $r['link'] = draw_link(url_base() . '/staff/view.php?id=' . $r['link'], $r['link']);
}
file_array($result, 'employees');
Example #13
0
            $title = request()->filter('trim', 'strip_tags')->input('title');
            $content = request()->filter('trim', 'strip_tags')->input('content');
            if (empty($title)) {
                $error = '标题不能为空';
            } elseif (empty($content)) {
                $error = '内容不能为空';
            } else {
                (new \Model\Post())->update($pid, $title, $content);
                response()->redirect(url_base() . '/post/' . $pid);
            }
        }
        return view('post-edit.php', ['post' => $post, 'error' => $error]);
    })->conditions(['pid' => '[0-9]+'])->name('post-edit');
}, function () {
    // 路由分组的过滤
    if (empty($_SESSION['uid'])) {
        response()->redirect(url_base() . '/login');
    }
});
// 路由参数
$app->get('/post/<pid>', function () {
    $pid = request()->filter('intval')->params('pid');
    $post = (new \Model\Post())->get($pid);
    if (!$post) {
        throw new \Lime\Exception\NotFoundException("Post not found");
    }
    return view('content.php', ['post' => $post]);
})->conditions(['pid' => '[0-9]+'])->name('post-page');
// 使用条件限制数组 和 路由命名
// 执行 Lime 应用
$app->run();
Example #14
0
function draw_navigation($options, $match = false, $type = "text", $class = "navigation")
{
    //type could be text, images or rollovers
    global $_josh;
    //debug();
    $return = $_josh["newline"] . $_josh["newline"] . "<!--start nav-->" . $_josh["newline"] . "<ul class='" . $class . "'>";
    if ($match === false) {
        $match = $_josh["request"]["path"];
    } elseif ($match === true) {
        $match = $_josh["request"]["path_query"];
    } elseif ($match == "//") {
        //to take care of a common / . folder . / scenario
        $match = "/";
    }
    error_debug("<b>draw_navigation</b> match is " . $match);
    $counter = 1;
    $javascript = $_josh["newline"];
    foreach ($options as $title => $url) {
        $name = 'option' . $counter;
        $return .= $_josh["newline"] . '<li><a href="' . $url . '" class="' . $name;
        if (str_replace(url_base(), "", $url) == $match) {
            $img_state = "_on";
            $return .= ' selected';
        } else {
            $img_state = "_off";
            if ($type == "rollovers") {
                $return .= '" onmouseover="javascript:roll(\'' . $name . '\',\'on\');" onmouseout="javascript:roll(\'' . $name . '\',\'off\');';
            }
        }
        $return .= '">';
        if ($type == "text") {
            $return .= $title;
        } elseif ($type == "images" || $type == "rollovers") {
            $img = str_replace("/", "", $url);
            if (empty($img)) {
                $img = "home";
            }
            $img = "/images/navigation/" . $img;
            if ($type == "rollovers") {
                $javascript .= $name . "_on\t\t = new Image;" . $_josh["newline"];
                $javascript .= $name . "_off\t = new Image;" . $_josh["newline"];
                $javascript .= $name . "_on.src\t = '" . $img . "_on.png';" . $_josh["newline"];
                $javascript .= $name . "_off.src = '" . $img . "_off.png';" . $_josh["newline"];
            }
            $img .= $img_state . ".png";
            $return .= draw_img($img, false, false, $name);
        }
        $return .= '</a></li>';
        $counter++;
    }
    $return .= $_josh["newline"] . "</ul>";
    if ($type == "rollovers") {
        $return = draw_javascript('if (document.images) {' . $javascript . '}
		function roll(what, how) { eval("document." + what + ".src = " + what + "_" + how + ".src;"); }') . $return;
    }
    return $return;
}
Example #15
0
    if (!DISABLE_TEAMS) {
        echo "\n            <li><a href=\"team.php\">Teams</a> - create or join a team\n        ";
    }
    echo "\n        </ul>\n        <h2 class=headline>" . tra("Community") . "</h2>\n        <ul>\n    ";
    if (!DISABLE_PROFILES) {
        echo "\n            <li><a href=\"profile_menu.php\">" . tra("Profiles") . "</a>\n        ";
    }
    echo "\n        <li><a href=\"user_search.php\">User search</a>\n        <li><a href=ffmail_form.php>Share</a>\n    ";
    if (!DISABLE_FORUMS) {
        echo "\n            <li><a href=\"forum_index.php\">" . tra("Message boards") . "</a>\n            <li><a href=\"forum_help_desk.php\">" . tra("Questions and Answers") . "</a>\n        ";
    }
    echo "\n        <li><a href=\"stats.php\">Statistics</a>\n        <li><a href=language_select.php>Languages</a>\n        </ul>\n        </div>\n    ";
}
$stopped = web_stopped();
$rssname = PROJECT . " RSS 2.0";
$rsslink = url_base() . "rss_main.php";
header("Content-type: text/html; charset=utf-8");
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
echo "<html>\n    <head>\n    <title>" . PROJECT . "</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\" media=\"all\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"" . STYLESHEET . "\">\n    <link rel=\"alternate\" type=\"application/rss+xml\" title=\"" . $rssname . "\" href=\"" . $rsslink . "\">\n";
include 'schedulers.txt';
if (defined("SHORTCUT_ICON")) {
    echo '<link rel="icon" type="image/x-icon", href="' . SHORTCUT_ICON . '"/>';
}
echo "\n    </head><body>\n    <div class=page_title>" . PROJECT . "</div>\n";
if (!$stopped) {
    get_logged_in_user(false);
    show_login_info();
}
echo "\n    <table cellpadding=\"8\" cellspacing=\"4\" class=\"table table-bordered\">\n    <tr><td rowspan=\"2\" valign=\"top\" width=\"40%\">\n";
if ($stopped) {
    echo "\n        <b>" . PROJECT . " is temporarily shut down for maintenance.\n        Please try again later</b>.\n    ";
Example #16
0
<?php

include "../include.php";
//die(htmlentities("'Nuñez", ISO8859-1));
$where = !isset($_GET["id"]) ? "" : "AND i.id IN (SELECT i2t.instanceID FROM contacts_instances_to_tags i2t WHERE i2t.tagID = " . implode(" OR i2t.tagID = ", explode("|", $_GET["id"])) . ")";
$result = db_query("SELECT\r\n\t\t\t\to.id,\r\n\t\t\t\t'" . url_base() . "/contacts/contact.php?id=' + cast(o.id as varchar) link,\r\n\t\t\t\t(SELECT TOP 1 t1.tag FROM contacts_tags t1 JOIN contacts_instances_to_tags i2t1 ON t1.id = i2t1.tagID WHERE t1.is_active = 1 AND t1.type_id = 10 AND i2t1.instanceID = o.instanceCurrentID) salutation,\r\n\t\t\t\ti.varchar_01 firstname,\r\n\t\t\t\ti.varchar_02 lastname,\r\n\t\t\t\t(SELECT TOP 1 t2.tag FROM contacts_tags t2 JOIN contacts_instances_to_tags i2t2 ON t2.id = i2t2.tagID WHERE t2.is_active = 1 AND t2.type_id = 11 AND i2t2.instanceID = o.instanceCurrentID) suffix,\r\n\t\t\t\ti.varchar_04 org,\r\n\t\t\t\ti.varchar_05 title,\r\n\t\t\t\ti.varchar_06 address1,\r\n\t\t\t\ti.varchar_07 address2,\r\n\t\t\t\tz.city,\r\n\t\t\t\tz.state,\r\n\t\t\t\tRIGHT('00000' + RTRIM(i.numeric_01), 5) zip,\r\n\t\t\t\ti.varchar_08 phone,\r\n\t\t\t\ti.varchar_09 fax,\r\n\t\t\t\ti.varchar_10 cell,\r\n\t\t\t\ti.varchar_11 email,\r\n\t\t\t\ti.text_01 notes,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t JOIN contacts_tags t ON i2t.tagID = t.id JOIN contacts_tags_types tt ON t.type_id = tt.id WHERE tt.is_active = 1 AND t.is_active = 1 AND i2t.instanceID = i.id) tagcount,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 216) tagAsset,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 217) tagComFin,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 7)   tagEconDev,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 220) tagFunders,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 218) tagTech,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 27)  tagWorkforce,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 13)  tagHigherEd,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 78)  tagForProfit,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 31)  tagGovt,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 93)  tagMedia,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 24)  tagNonProfit,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 80)  tagVendor,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 131) tagSeedcoBoard,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 219) tagSFSBoard,\r\n\t\t\t\t(SELECT count(*) FROM contacts_instances_to_tags i2t WHERE i2t.instanceID = i.id AND i2t.tagID = 221) tagImported\r\n\t\t\tFROM contacts o\r\n\t\t\tINNER JOIN contacts_instances i ON i.id = o.instanceCurrentID\r\n\t\t\tLEFT  JOIN zip_codes z ON i.numeric_01 = z.zip\r\n\t\t\tWHERE o.type_id = 22 AND o.is_active = 1 {$where}\r\n\t\t\tORDER BY \r\n\t\t\t\tlastname, \r\n\t\t\t\tfirstname");
$return = '<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>joshuar</Author>
  <LastAuthor>joshuar</LastAuthor>
  <Created>2006-06-09T17:38:52Z</Created>
  <LastSaved>2006-06-09T18:33:53Z</LastSaved>
  <Company>seedco</Company>
  <Version>11.6568</Version>
 </DocumentProperties>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>13035</WindowHeight>
  <WindowWidth>15195</WindowWidth>
  <WindowTopX>480</WindowTopX>
  <WindowTopY>60</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
Example #17
0
function url_query_drop($deletes = false, $go = true)
{
    //purpose: clear specified query arguments, or clear everything if unspecified
    //called by: lots of pages on the intranet, eg /staff/view.php
    //accepts: $deletes is a one-dimensional array of keys, eg array("id", "action", "chicken"), $go is boolean
    //deletes could also be a comma-separated list
    global $_josh;
    $get = $_GET;
    $target = url_base() . $_josh["request"]["path"];
    if ($deletes) {
        if (!is_array($deletes)) {
            $deletes = explode(",", $deletes);
        }
        foreach ($deletes as $key) {
            $key = trim($key);
            if (array_key_exists($key, $get)) {
                unset($get[$key]);
            }
        }
        $pairs = array();
        reset($get);
        while (list($key, $value) = each($get)) {
            if ($value) {
                $pairs[] = $key . "=" . $value;
            }
        }
        sort($pairs);
        if (count($pairs)) {
            $target .= "?" . implode("&", $pairs);
        }
    }
    if ($go) {
        url_change($target);
    }
    return $target;
}
Example #18
0
<li>
    <img src="<?php 
iv('image_src');
?>
" alt="<?php 
iv('image_name');
?>
">
    <p><?php 
iv('image_uploaded');
?>
 | <?php 
iv('image_imgsize');
?>
 кб</p>
    <p class="description" style="height: 20px; overflow: hidden"><?php 
iv('image_description');
?>
</p>
    <a class="btn edit" href="<?php 
url_base('gallery', 'form', 'image_id');
?>
">Edit |</a>
    <a class="btn delete" href="<?php 
url_base('gallery', 'delete', 'image_id', 'list');
?>
">Delete</a>
</li>

Example #19
0
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util.inc";
require_once "../inc/user.inc";
require_once "../inc/boinc_db.inc";
check_get_args(array("code", "userid"));
$code = get_str("code");
$userid = get_int('userid');
$user = BoincUser::lookup_id($userid);
if (!$user) {
    error_page("no such user");
}
if (salted_key($user->authenticator) != $code) {
    error_page("invalid code");
}
$result = $user->update("send_email=0");
if ($result) {
    page_head("Removed from mailing list");
    echo "\n        No further emails will be sent to {$user->email_addr}.\n        <p>\n        To resume getting emails,\n        <a href=" . url_base() . "prefs_edit.php?subset=project>edit your project preferences</a>.\n    ";
    page_tail();
}
 * Created by PhpStorm.
 * User: anazarenko
 * Date: 22.09.2014
 * Time: 12:42
 */
?>
<form id="addPhotoForm" action="<?php 
url_base('gallery', 'save', 'list');
?>
" enctype="multipart/form-data" method="post">
    <input type="hidden" name="id" value="<?php 
iv('image_id');
?>
">
    <input type="hidden" class="__action" value="<?php 
url_base('gallery', 'upload');
?>
">
    <input type="hidden" class="__file_size" name="maxSize" value="1000000">
    <input class="__file_name" name="name" placeholder="name" value="<?php 
iv('image_name');
?>
">
    <textarea name="description" placeholder="description"><?php 
iv('image_description');
?>
</textarea>
<input class="__upload" type="file" name="file" value="<?php 
iv('image_src');
?>
">
Example #21
0
    $target = "/staff/changes.php";
} elseif (stristr($req, "/departments/administration")) {
    $target = str_replace("/departments/administration", "/openings", $req);
} elseif (stristr($req, "/departments/earnfair")) {
    $target = str_replace("/departments/earnfair", "/queries", $req);
} elseif (stristr($req, "/departments/resource_development")) {
    $target = str_replace("/departments/resource_development", "/funders", $req);
} elseif (stristr($req, "/docs")) {
    $target = str_replace("/docs", "/docs", $req);
} elseif (stristr($req, "/btw")) {
    //back to work application ~ used to have the intranet domain
    $target = "http://btw.seedco.org" . $req;
} elseif (stristr($req, "msoffice/cltreq.asp")) {
    //m$ft internet explorer discussion bar, no redirect
} elseif (stristr($req, "favicon.ico")) {
    //site favorite icon, no redirect
} elseif (stristr($req, "_vti_")) {
    //looking for m$ft front page extensions, no redirect
} elseif ($_SESSION["user_id"] != 1) {
    //user is admin, send email
    $msg = $_SESSION["full_name"] . " couldn't find " . url_base() . $req;
    if ($referrer) {
        $msg .= "<br><br>Referred by " . $referrer;
    }
}
if ($target) {
    url_change($target, true);
}
echo drawTop();
echo drawMessage("<b>Error: Page Not Found</b><br>\nSorry, the page you're looking for isn't here!  If you feel you reached this page in error, please contact \n<a href='mailto:josh@joshreisner.com'>Josh Reisner</a> so it can be fixed.");
echo drawBottom();
Example #22
0
function pagestart_nobody($titletext, $addcss = '')
{
    global $debug;
    global $tbpref;
    @header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
    @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    @header('Cache-Control: no-cache, must-revalidate, max-age=0');
    @header('Pragma: no-cache');
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	
<!-- ***********************************************************
"Learning with Texts" (LWT) is free and unencumbered software 
released into the PUBLIC DOMAIN.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a
compiled binary, for any purpose, commercial or non-commercial,
and by any means.

In jurisdictions that recognize copyright laws, the author or
authors of this software dedicate any and all copyright
interest in the software to the public domain. We make this
dedication for the benefit of the public at large and to the 
detriment of our heirs and successors. We intend this 
dedication to be an overt act of relinquishment in perpetuity
of all present and future rights to this software under
copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE SOFTWARE.

For more information, please refer to [http://unlicense.org/].
************************************************************ -->

	<meta name="viewport" content="width=900" />
	<link rel="apple-touch-icon" href="img/apple-touch-icon-57x57.png" />
	<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png" />
	<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114.png" />
	<link rel="apple-touch-startup-image" href="img/apple-touch-startup.png">
	<meta name="apple-mobile-web-app-capable" content="yes" />
	
	<link rel="stylesheet" type="text/css" href="css/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="css/jquery.tagit.css">
	<link rel="stylesheet" type="text/css" href="css/styles.css">
	<style type="text/css">
	<?php 
    echo $addcss . "\n";
    ?>
	</style>
	
	<script type="text/javascript" src="js/jquery.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/jquery.scrollTo.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/jquery-ui.min.js"  charset="utf-8"></script>
	<script type="text/javascript" src="js/tag-it.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/jquery.jeditable.mini.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/sorttable/sorttable.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/countuptimer.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/overlib/overlib_mini.js" charset="utf-8"></script>
	<!-- URLBASE : "<?php 
    echo tohtml(url_base());
    ?>
" -->
	<!-- TBPREF  : "<?php 
    echo tohtml($tbpref);
    ?>
" -->
	<script type="text/javascript">
	//<![CDATA[
	<?php 
    echo "var STATUSES = " . json_encode(get_statuses()) . ";\n";
    ?>
	<?php 
    echo "var TAGS = " . json_encode(get_tags()) . ";\n";
    ?>
	<?php 
    echo "var TEXTTAGS = " . json_encode(get_texttags()) . ";\n";
    ?>
	//]]>
	</script>
	<script type="text/javascript" src="js/pgm.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/jq_pgm.js" charset="utf-8"></script>
	
	<title>LWT :: <?php 
    echo $titletext;
    ?>
</title>
</head>
<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<?php 
    if ($debug) {
        showRequest();
    }
}
Example #23
0
function login_with_ldap($uid, $passwd, $next_url, $perm)
{
    list($ldap_user, $error_msg) = ldap_auth($uid, $passwd);
    if ($error_msg) {
        error_page($error_msg);
    }
    $x = ldap_email_string($uid);
    $user = BoincUser::lookup_email_addr($x);
    if (!$user) {
        // LDAP authentication succeeded but we don't have a user record.
        // Create one.
        //
        $user = make_user_ldap($x, $ldap_user->name);
    }
    if (!$user) {
        error_page("Couldn't create user");
    }
    Header("Location: " . url_base() . "{$next_url}");
    send_cookie('auth', $user->authenticator, $perm);
    return;
}
Example #24
0
            }
            if (!is_valid_country($country)) {
                echo "bad country";
                exit;
            }
            $postal_code = '';
            $user = make_user($new_email_addr, $new_name, $passwd_hash, $country, $postal_code, $project_prefs = "", $teamid = 0);
            if (!$user) {
                show_error("Couldn't create account");
            }
            if (defined('INVITE_CODES')) {
                error_log("Account '{$new_email_addr}' created using invitation code '{$invite_code}'");
            }
        }
        // Log-in user in the web
        // In success case, redirect to a fixed page so that user can
        // return to it without getting "Repost form data" stuff
        $next_url = post_str('next_url', true);
        $next_url = sanitize_local_url($next_url);
        if ($next_url) {
            Header("Location: " . url_base() . "{$next_url}");
        } else {
            Header("Location: " . url_base() . "home.php");
            send_cookie('init', "1", true);
            send_cookie('via_web', "1", true);
        }
        send_cookie('auth', $user->authenticator, true);
    }
} catch (ErrorException $e) {
    echo $e->getMessage();
}
Example #25
0
$this->extend('layout.php');
?>

<?php 
if (isset($error)) {
    ?>
<p class="alert"><?php 
    echo $error;
    ?>
</p>
<?php 
}
?>

<form class="form-post" method="post" action="<?php 
echo url_base();
?>
/post/edit/<?php 
echo $post['pid'];
?>
">
    <h2>编辑文章</h2>
    <label for="title" class="sr-only">标题</label>
    <input type="text" id="title" name="title" class="form-control" value="<?php 
echo request()->input('title', $post['title']);
?>
" placeholder="标题">
    <label for="content" class="sr-only">文章内容</label>
    <textarea id="content" name="content" placeholder="输入文章内容" rows="10"><?php 
echo request()->input('content', $post['content']);
?>
Example #26
0
						y.title' . langExt($lang) . ' type,
						t.created_date
					FROM bb_topics t
					LEFT JOIN bb_topics_types y ON t.type_id = y.id
					WHERE t.id = ' . $_POST['topic_id']);
            $reply = db_grab('SELECT
						f.description' . langExt($lang) . ' description,
						ISNULL(u.nickname, u.firstname) firstname, 
						u.lastname
					FROM bb_followups f
					JOIN users u ON f.created_user = u.id
					WHERE f.id = ' . $id);
            $channels_text = db_array('SELECT c.title' . langExt($lang) . ' FROM bb_topics_to_channels t2c JOIN channels c ON t2c.channel_id = c.id WHERE t2c.topic_id = ' . $_POST['topic_id']);
            $channels_text = implode(', ', $channels_text);
            $message = '<p style="font-weight:bold;">' . $reply['firstname'] . ' ' . $reply['lastname'] . ' ' . getString('bb_followup', $lang) . '</p>
				<p>' . getString('title', $lang) . ': ' . draw_link(url_base() . '/bb/topic.php?id=' . $id, $topic['title']) . '</p>
				<p>' . getString('channels_label', $lang) . ': ' . $channels_text . '</p>';
            if ($topic['type']) {
                $message .= '<p>' . getString('category', $lang) . ': ' . $topic['type'] . '</p>';
            }
            $message .= '<div style="color:#555; border-top:1px dotted #555; padding-top:5px; margin-top:5px;">' . $reply['description'] . '</div>';
            emailUser($emails, 'RE: ' . $topic['title'], $message);
        }
    }
    bbDrawRss();
    url_change();
} elseif (isset($_GET['delete'])) {
    db_delete('bb_topics');
    bbDrawRss();
    url_change('/bb/');
} elseif (isset($_GET['deleteFollowupID'])) {
Example #27
0
                echo $_G['project']['home'];
                ?>
api.php?action=service&execute=install&appname=<?php 
                echo $_G['product']['appname'];
                ?>
&version=<?php 
                echo $_G['product']['version'];
                ?>
&domain=<?php 
                echo url_host();
                ?>
&licence=<?php 
                echo $_G['licence']['type'];
                ?>
&host=<?php 
                echo urlencode(url_fore() . url_base());
                ?>
">/*发送安装命令*/</script>
					        
							<p> <button type="button" onclick="location.replace('./');">立即登入</button> </p>
	
							<?php 
            }
        }
    }
    ?>
	
	        
	        <?php 
}
?>
Example #28
0
$uotd_candidates = count_uotd_candidates();
if ($uotd_candidates >= 0) {
    if ($uotd_candidates >= UOTD_THRESHOLD * 2) {
        $color = "#00aa00";
    } elseif ($uotd_candidates < UOTD_THRESHOLD) {
        $color = "#ff0000";
    } else {
        $color = "#ff9900";
    }
    echo "<li><span style=\"color: " . $color . "\">\n        There are " . $uotd_candidates . " remaining candidates for User of the Day.\n        </span></li>\n    ";
}
echo "</ul>\n";
if (function_exists('admin_index_extra')) {
    admin_index_extra();
}
echo "\n    <p>\n    <table border=\"0\"><tr valign=\"top\">\n    <td><b>Browse database:</b>\n    <ul> \n        <li><a href=\"db_form.php?table=result&amp;detail=low\">Results</a></li>\n        <li><a href=\"db_form.php?table=workunit\">Workunits</a></li>\n        <li><a href=\"db_form.php?table=host&amp;detail=low\">Hosts</a></li>\n        <li><a href=\"db_form.php?table=user\">Users</a> (<a href=\"list_new_users.php\">recently registered</a>)</li>\n        <li><a href=\"db_form.php?table=team\">Teams</a></li>\n        <li><a href=\"db_action.php?table=app\">Applications</a></li>\n        <li><a href=\"db_form.php?table=app_version\">Application versions</a></li>\n        <li><a href=\"db_action.php?table=platform\">Platforms</a></li>\n        <li><a href=dbinfo.php>DB row counts and disk usage</a>\n        <li><a href=\"show_log.php?f=mysql*.log&amp;l=-20\">Tail MySQL logs</a>\n    </ul>\n    \n\n    </td> \n    <td><b>Computing</b>\n    <ul>\n        <li><a href=\"manage_apps.php\">Manage applications</a></li>\n        <li><a href=\"manage_app_versions.php\">Manage application versions</a></li>\n        <li> Manage jobs\n        <ul>\n            <li><a href=\"cancel_wu_form.php\">Cancel jobs by ID</a>\n            <li><a href=\"cancel_workunits.php\">Cancel jobs by SQL clause</a>\n            <li><a href=transition_all.php>Transition jobs</a>\n              <p class=\"text-muted\">(this can 'unstick' old jobs)</p>\n            <li><a href=\"revalidate.php\">Re-validate jobs</a>\n            <li><a href=assign.php>Assigned jobs</a>\n        </ul>\n        <li><a href=\"job_times.php\">FLOP count statistics</a>\n        <li><a href=\"{$stripchart_cgi_url}/stripchart.cgi\">Stripcharts</a>\n        <li><a href=\"show_log.php\">Show/Grep logs</a>\n        <li>\n            <form method=\"get\" action=\"clear_host.php\">\n            <input class=\"btn btn-default\" type=\"submit\" value=\"Clear RPC seqno\">\n            host ID: \n            <input type=\"text\" size=\"5\" name=\"hostid\">\n            </form>\n    </ul>\n    \n    </td> \n    <td><b>User management</b>\n    <ul>\n        <li><a href=" . url_base() . "/forum_index.php>Post news item</a></li>\n        <li><a href=\"profile_screen_form.php\">Screen user profiles </a></li>\n        <li><a href=\"badge_admin.php\">Badges</a></li>\n        <li><a href=\"manage_special_users.php\">User privileges</a></li>\n        <li><a href=" . url_base() . "/manage_project.php>User job submission privileges</a></li>\n        <li><a href=\"mass_email.php\">Send mass email to a selected set of users</a></li>\n        <li><form action=\"manage_user.php\">\n            <input class=\"btn btn-default\" type=\"submit\" value=\"Manage user\">\n            ID: <input name=\"userid\">\n            </form>\n        </li>\n    </ul>\n    </td>\n    </tr>\n    </table>\n";
// Result Summaries:
$show_deprecated = get_str("show_deprecated", true);
$show_only = array("all");
// Add all appids you want to display, or "all"
$apps = BoincApp::enum("");
foreach ($apps as $app) {
    if (in_array($app->id, $show_only) || in_array("all", $show_only) && (!$app->deprecated || $show_deprecated)) {
        echo "\n            <b>Results for <tt>{$app->name}</tt>:</b>\n            <ul>\n";
        for ($i = 0; $i < 2; $i++) {
            if ($i) {
                $secs = 7 * 86400;
                $period = "&nbsp;&nbsp;&nbsp;7 days";
            } else {
                $secs = 86400;
                $period = "24 hours";
Example #29
0
<?php

/**
 * Created by PhpStorm.
 * User: anazarenko
 * Date: 16.09.14
 * Time: 13:22
 */
?>
<form id="editForm" action="<?php 
url_base('gallery', 'edit', 'image_id', 'list');
?>
" method="post" enctype="multipart/form-data">
    <h2>Edit Form</h2>
    <input type="hidden" name="id" value="<?php 
iv('image_id');
?>
">
    Name: <input name="name" value="<?php 
iv('image_name');
?>
">
    Description: <textarea name="description"><?php 
iv('image_description');
?>
</textarea>
    <input type="submit" value="Edit!">
</form>
Example #30
0
 } elseif (getOption('requests') && ($id = db_grab('SELECT id FROM users_requests WHERE email = "' . $_POST['email'] . '"'))) {
     db_save('users_requests', $id);
     emailAdmins('Repeat Account Request', $_POST['firstname'] . ' ' . $_POST['lastname'] . ' is ' . draw_link(url_base() . '/staff/add_edit.php?requestID=' . $id, 're-requesting an account'));
 } else {
     if (getOption('requests')) {
         $id = db_save('users_requests');
         //if (getOption('channels')) db_checkboxes('email_prefs', 'requests_to_channels_prefs', 'request_id', 'channel_id', $id);
         $subject = 'New User Request';
         $link = url_base() . '/staff/add_edit.php?requestID=' . $id;
     } else {
         $id = db_save('users');
         if (getOption('channels')) {
             db_checkboxes('email_prefs', 'users_to_channels_prefs', 'user_id', 'channel_id', $id);
         }
         $subject = 'New User Registration';
         $link = url_base() . '/staff/add_edit.php?id=' . $id;
         emailInvite($id);
     }
     //prepare email
     $message = '';
     reset($_POST);
     while (list($key, $value) = each($_POST)) {
         if ($key == 'email') {
             $value = draw_link('mailto:' . $value);
         } elseif ($key == 'departmentID' && $value) {
             $value = db_grab('SELECT departmentName FROM departments WHERE departmentID = ' . $value);
         } elseif ($key == 'officeID' && $value) {
             $value = db_grab('SELECT name FROM offices WHERE id = ' . $value);
         } elseif ($key == 'organization_id' && $value) {
             $value = db_grab('SELECT title from organizations WHERE id = ' . $value);
         } elseif ($key == 'Additional Info') {