Example #1
0
 function Ysearch($appid, $site = false)
 {
     $this->appid = $appid;
     if (!$site) {
         $this->site = site_domain();
     } else {
         $this->site = $site;
     }
 }
Example #2
0
 function onSubmit($vals)
 {
     loader_import('sitepoll.Comment');
     $c = new SitepollComment();
     $vals['ts'] = date('Y-m-d H:i:s');
     unset($vals['submit_button']);
     $c->add($vals);
     $ce = appconf('comments_email');
     if ($ce) {
         @mail($ce, intl_get('Poll Comment Notice'), template_simple('comment_email.spt', $vals), 'From: ' . 'sitepoll@' . site_domain());
     }
     page_title(intl_get('Comment Added'));
     echo template_simple('comment_added.spt', $vals);
 }
Example #3
0
 function onSubmit($vals)
 {
     if ($this->parameters['save'] == 'yes') {
         // save to sitellite_form_submission table
         $parts = explode(' ', $vals['name']);
         $first = array_shift($parts);
         $last = join(' ', $parts);
         db_execute('insert into sitellite_form_submission values (null, ?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', 1, 'Contact Form', $_SERVER['REMOTE_ADDR'], null, null, null, $first, $last, $vals['from'], null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, $vals['message']);
     }
     if (!@mail($this->parameters['email'], '[' . site_domain() . '] ' . intl_get('Contact Form'), template_simple('util_contact_email.spt', $vals), 'From: ' . $vals['name'] . ' <' . $vals['from'] . '>')) {
         page_title(intl_get('An Error Occurred'));
         echo '<p>' . intl_get('Our apologies, your message failed to be sent.  Please try again later.') . '</p>';
         return;
     }
     page_title(intl_get('Thank You'));
     echo template_simple('util_contact_thanks.spt');
 }
Example #4
0
    function onSubmit($vals)
    {
        // 1. insert into sitefaq_submission table
        if ($vals['url'] == 'http://') {
            $vals['url'] = '';
        }
        $member_id = session_username();
        if (!$member_id) {
            $member_id = '';
        }
        if (!$vals['name']) {
            $vals['name'] = '';
        }
        if (!$vals['age']) {
            $vals['age'] = '';
        }
        if (!$vals['url']) {
            $vals['url'] = '';
        }
        db_execute('insert into sitefaq_submission
				(id, question, answer, ts, assigned_to, email, member_id, ip, name, age, url, sitellite_status, sitellite_access, sitellite_owner, sitellite_team)
			values
				(null, ?, "", now(), "", ?, ?, ?, ?, ?, ?, "draft", "private", "", "none")', $vals['question'], $vals['email'], $member_id, $_SERVER['REMOTE_ADDR'], $vals['name'], $vals['age'], $vals['url']);
        // 2. email all admins
        $admin_roles = session_admin_roles();
        $emails = db_shift_array('select distinct email from sitellite_user
			where role in("' . join('", "', $admin_roles) . '")');
        foreach ($emails as $email) {
            @mail($email, intl_get('FAQ Submission Notice'), template_simple('email_notice.spt', $vals), 'From: faq@' . str_replace('www.', '', site_domain()));
        }
        // 4. if the user provided an email address, send a thank you
        if (!empty($vals['email'])) {
            @mail($vals['email'], intl_get('FAQ Submission Received'), template_simple('email_thank_you.spt', $vals), 'From: faq@' . str_replace('www.', '', site_domain()));
        }
        // 3. output a thank you
        page_title(intl_get('Thank You'));
        echo template_simple('thank_you.spt', $vals);
    }
Example #5
0
    return;
}
if (session_admin()) {
    $acl = session_allowed_sql();
} else {
    $acl = session_approved_sql();
}
if (!$parameters['limit'] || $parameters['limit'] == 0 || !is_numeric($parameters['limit'])) {
    $limit = '';
} else {
    $limit = ' limit ' . $parameters['limit'];
}
$res = db_fetch_array('select name, display_title, extension, description, filesize from sitellite_filesystem where path = ? and ' . $acl . ' order by last_modified desc' . $limit, $parameters['path']);
$valid = appconf('valid');
$mimes = appconf('mimes');
foreach (array_keys($res) as $k) {
    if (!in_array(strtolower($res[$k]->extension), $valid)) {
        unset($res[$k]);
    }
    if (empty($res[$k]->display_title)) {
        $res[$k]->display_title = preg_replace('/[^a-zA-Z0-9-]+/', ' ', $res[$k]->name);
    }
    $res[$k]->type = $mimes[strtolower($res[$k]->extension)];
}
header('Content-Type: application/rss+xml');
template_simple_register('results', $res);
if (!$parameters['title']) {
    $parameters['title'] = site_domain() . ' Podcast';
}
echo template_simple('podcast.spt', array('title' => $parameters['title'], 'path' => $parameters['path'], 'desc' => $parameters['descriptions']));
exit;
Example #6
0
    if (strpos($file, '.') === 0 || @is_dir('inc/app/cms/conf/collections/' . $file)) {
        continue;
    }
    $config = ini_parse('inc/app/cms/conf/collections/' . $file);
    if (isset($config['Collection']['sitesearch_url'])) {
        if (isset($config['Collection']['sitesearch_access']) && session_allowed($config['Collection']['sitesearch_access'], 'r', 'access')) {
            $sitesearch_allowed[] = $config['Collection']['name'];
        }
        $sitesearch_highlight[$config['Collection']['name']] = $config['Collection']['name'];
        if (isset($config['Collection']['sitesearch_highlight']) && !$config['Collection']['sitesearch_highlight']) {
            unset($sitesearch_highlight[$config['Collection']['name']]);
        }
    }
}
$folders = ini_parse('inc/app/sitesearch/conf/folders.ini.php');
$domains = array(site_domain() => site_domain());
foreach ($folders as $name => $folder) {
    if (isset($folder['domain'])) {
        $domains[$folder['domain']] = $folder['domain'];
    } else {
        $sitesearch_allowed[] = $name;
    }
}
if (!empty($parameters['query'])) {
    loader_import('sitesearch.SiteSearch');
    $searcher = new SiteSearch();
    if (is_array($parameters['ctype'])) {
        $collections = $parameters['ctype'];
        foreach ($collections as $k => $ctype) {
            if (!in_array($ctype, $sitesearch_allowed)) {
                unset($collections[$k]);
Example #7
0
 function onSubmit($vals)
 {
     loader_import('siteforum.Post');
     loader_import('siteforum.Filters');
     loader_import('siteforum.Topic');
     $p = new SiteForum_Post();
     if (!session_admin()) {
         $notice = 'no';
     } else {
         if ($vals['notice'] == 'Make this post a notice.') {
             $notice = 'yes';
         } else {
             $notice = 'no';
         }
     }
     $t = new SiteForum_Topic();
     $topic = $t->get($vals['topic']);
     if (!($res = $p->add(array('user_id' => session_username(), 'topic_id' => $vals['topic'], 'post_id' => $vals['post'], 'ts' => date('Y-m-d H:i:s'), 'subject' => $vals['subject'], 'body' => $vals['body'], 'sig' => db_shift('select sig from sitellite_user where username = ?', session_username()), 'notice' => $notice, 'sitellite_access' => $topic->sitellite_access, 'sitellite_status' => $topic->sitellite_status)))) {
         page_title(intl_get('Database Error'));
         echo '<p>' . intl_get('An error occurred.  Please try again later.') . '</p>';
         echo '<p>' . intl_get('Error Message') . ': ' . $p->error . '</p>';
         return;
     }
     $vals['id'] = $res;
     if (!empty($vals['post'])) {
         $p->touch($vals['post']);
     }
     if ($vals['subscribe'] == 'Subscribe me to this forum thread.') {
         if (!$vals['post']) {
             $vals['post'] = $res;
         }
         db_execute('insert into siteforum_subscribe (id, post_id, user_id) values (null, ?, ?)', $vals['post'], session_username());
     }
     $ae = appconf('admin_email');
     if ($ae) {
         @mail($ae, intl_get('Forum Posting Notice'), template_simple('post_email.spt', $vals), 'From: ' . appconf('forum_name') . '@' . site_domain());
     }
     $exempt = explode(',', $ae);
     $res = db_fetch_array('select distinct u.email, u.username from sitellite_user u, siteforum_subscribe s where s.user_id = u.username and s.post_id = ?', $vals['post']);
     foreach ($res as $row) {
         if (in_array($row->email, $exempt)) {
             continue;
         }
         $vals['user_id'] = $row->username;
         @mail($row->email, intl_get('Forum Posting Notice'), template_simple('post_email_subscriber.spt', $vals), 'From: ' . appconf('forum_name') . '@' . site_domain());
     }
     page_title(intl_get('Message Posted'));
     echo template_simple('post_submitted.spt', $vals);
 }
Example #8
0
 * app itself, and the breadcrumb trail as well.
 */
appconf_set('page_below', false);
/**
 * Set this to the ID of the page which is an alias of the app.
 */
appconf_set('page_alias', false);
/**
 * This loads the settings.ini.php file now so the defaults there can affect
 * subsequent function calls like page_add_style() below in this file.
 */
appconf_default_settings();
if ($context == 'action') {
    if (appconf('page_below')) {
        page_below(appconf('page_below'));
    }
    if (appconf('page_alias')) {
        page_id(appconf('page_alias'));
    }
    if (appconf('template')) {
        page_template(appconf('template'));
    }
    global $cgi;
    $url = 'http://' . site_domain() . site_prefix() . '/index/news-rss-action/nomenu.1';
    if ($cgi->section) {
        $url .= '?section=' . $cgi->section;
    } elseif ($cgi->author) {
        $url .= '?author=' . $cgi->author;
    }
    page_add_link('alternate', 'application/rss+xml', $url);
}
Example #9
0
 /**
  * Force the current page to be made over HTTP.
  *
  * @access	public
  *
  */
 function forceHttp()
 {
     header('Location: http://' . site_domain() . site_current() . '?' . $_SERVER['QUERY_STRING']);
     exit;
 }
Example #10
0
appconf_set('short_date', '%B %e');
// This loads the settings.ini.php file now so the defaults there can affect
// subsequent function calls like page_add_style() below in this file.
appconf_default_settings();
formdata_set('hours', array('00:00:00' => '- SELECT -', '08:00:00' => '&nbsp;8:00 AM', '08:30:00' => '&nbsp;8:30 AM', '09:00:00' => '&nbsp;9:00 AM', '09:30:00' => '&nbsp;9:30 AM', '10:00:00' => '10:00 AM', '10:30:00' => '10:30 AM', '11:00:00' => '11:00 AM', '11:30:00' => '11:30 AM', '12:00:00' => '12:00 PM', '12:30:00' => '12:30 PM', '13:00:00' => '&nbsp;1:00 PM', '13:30:00' => '&nbsp;1:30 PM', '14:00:00' => '&nbsp;2:00 PM', '14:30:00' => '&nbsp;2:30 PM', '15:00:00' => '&nbsp;3:00 PM', '15:30:00' => '&nbsp;3:30 PM', '16:00:00' => '&nbsp;4:00 PM', '16:30:00' => '&nbsp;4:30 PM', '17:00:00' => '&nbsp;5:00 PM', '17:30:00' => '&nbsp;5:30 PM', '18:00:00' => '&nbsp;6:00 PM', '18:30:00' => '&nbsp;6:30 PM', '19:00:00' => '&nbsp;7:00 PM', '19:30:00' => '&nbsp;7:30 PM', '20:00:00' => '&nbsp;8:00 PM', '20:30:00' => '&nbsp;8:30 PM', '21:00:00' => '&nbsp;9:00 PM', '21:30:00' => '&nbsp;9:30 PM', '22:00:00' => '10:00 PM', '22:30:00' => '10:30 PM', '23:00:00' => '11:00 PM', '23:30:00' => '11:30 PM'));
formdata_set('recurring', array('no' => '- ' . intl_get('SELECT') . ' -', 'daily' => intl_get('Daily'), 'weekly' => intl_get('Weekly'), 'monthly' => intl_get('Monthly'), 'yearly' => intl_get('Yearly')));
if ($context == 'action') {
    if (appconf('page_below')) {
        page_below(appconf('page_below'));
    }
    if (appconf('page_alias')) {
        page_id(appconf('page_alias'));
    }
    if (appconf('template')) {
        page_template(appconf('template'));
    }
    global $cgi;
    $url = 'http://' . site_domain() . site_prefix() . '/index/siteevent-rss-action';
    $url2 = 'http://' . site_domain() . site_prefix() . '/index/siteevent-ical-action';
    if ($cgi->category) {
        $url .= '?category=' . $cgi->category;
        $url2 .= '?category=' . $cgi->category;
    } elseif ($cgi->user) {
        $url .= '?user='******'?user='******'alternate', 'application/rss+xml', $url);
    page_add_link('alternate', 'text/calendar', $url2);
    page_add_style(appconf('css_location'));
}
loader_import('siteevent.Filters');
Example #11
0
 }
 //if (session_admin ()) {
 //	echo  '<div class="scm-sidebar scm-status-' . str_replace (array (' ', '_'), array ('-', '-'), $row->sitellite_status) . '" id="scm-sidebar-' . str_replace ('_', '-', $row->id) . '">';
 //} else {
 echo '<div class="scm-sidebar" id="scm-sidebar-' . str_replace('_', '-', $row->id) . '">';
 //}
 if (session_admin()) {
     $GLOBALS['scm_sidebar_body'] = $row->body;
     $buttons = loader_box('cms/buttons', array('collection' => 'sitellite_sidebar', 'id' => $row->id, 'status' => $row->sitellite_status, 'access' => $row->sitellite_access, 'team' => $row->sitellite_team, 'add' => false, 'float' => true, 'up' => $up, 'down' => $down, 'upkey' => $upkey, 'downkey' => $downkey, 'return' => site_current()));
     $row->body = $GLOBALS['scm_sidebar_body'];
 } else {
     $buttons = '';
 }
 if (!empty($row->alias)) {
     if (strstr($row->alias, '?')) {
         $parts = parse_url('box://' . site_domain() . '/' . $row->alias);
         $boxname = substr($parts['path'], 1);
         parse_str($parts['query'], $params);
     } else {
         $boxname = $row->alias;
         $params = array();
     }
     $out = loader_box($boxname, $params, 'sidebar');
     if (!empty($out)) {
         echo $buttons;
         if (!empty($row->title)) {
             echo '<h2>' . $row->title . "</h2>\n\n";
         }
         echo '<div class="scm-sidebar-body">' . $out . '</div>';
     }
     echo '</div>';
Example #12
0
<?php

if (conf('Site', 'secure') && (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on')) {
    header('Location: https://' . site_domain() . $_SERVER['REQUEST_URI']);
    exit;
}
echo template_simple('layout/frames.spt', array('user' => $parameters['username'], 'forward' => $parameters['forward']));
exit;
/*
if (! session_admin ()) {
	page_title (intl_get ('Welcome to Sitellite 4'));

	global $cgi;

	if (isset ($cgi->username)) {
		echo '<p>' . intl_get ('Invalid login.  Please try again.') . '</p>';
	} else {
		echo '<p>' . intl_get ('Please login to begin your session.') . '</p>';
	}

	echo template_simple ('<form method="post" action="{site/prefix}/index/sitellite-user-login-action">
		<input type="hidden" name="goto" value="cms-app" />
		<table cellpadding="5" border="0">
			<tr>
				<td>{intl Username}</td>
				<td><input type="text" name="username" /></td>
			</tr>
			<tr>
				<td>{intl Password}</td>
				<td><input type="password" name="password" /></td>
			</tr>
Example #13
0
<?php

if (session_admin()) {
    $allowed = session_allowed_sql();
} else {
    $allowed = session_approved_sql();
}
$pres = db_single('select * from sitepresenter_presentation where id = ? and ' . $allowed, $parameters['id']);
if (!$pres) {
    header('Location: ' . site_prefix() . '/index/sitepresenter-app');
    exit;
}
loader_import('saf.Date');
$pres->date = Date::format($pres->ts, 'Ymd');
$pres->fmdate = Date::format($pres->ts, 'F j, Y');
$res = db_single('select concat(firstname, " ", lastname) as author, company from sitellite_user where username = ?', $pres->sitellite_owner);
$pres->author = $res->author;
$pres->company = $res->company;
$doms = explode('.', site_domain());
$pres->domain = array_pop($doms);
$pres->domain = '.' . $pres->domain;
$pres->domain = array_pop($doms) . $pres->domain;
$pres->slides = db_fetch_array('select * from sitepresenter_slide where presentation = ? order by number asc', $parameters['id']);
db_execute('insert into sitepresenter_view (presentation, ts, ip) values (?, now(), ?)', $parameters['id'], $_SERVER['REMOTE_ADDR']);
if (isset($parameters['theme']) && !strpos($parameters['theme'], '..') && @is_dir('inc/app/sitepresenter/themes/' . $parameters['theme'])) {
    $pres->theme = $parameters['theme'];
}
echo template_simple('presentation.spt', $pres);
exit;
Example #14
0
<?php

global $cgi;
if ($cgi->do == 'Done') {
    foreach ($cgi->done as $id) {
        db_execute('update todo_list set done = now() where id = ?', $id);
    }
    $list = db_fetch_array('select * from todo_list where id = ?', $id);
} elseif ($cgi->do = 'All') {
    $where = '';
    if (!empty($cgi->pp)) {
        $where .= ' and person = ' . db_quote($cgi->pp);
    }
    if (!empty($cgi->proj)) {
        $where .= ' and project = ' . db_quote($cgi->proj);
    }
    if (!empty($cgi->qq)) {
        $where .= ' and todo like ' . db_quote('%' . $cgi->qq . '%');
    }
    $list = db_fetch_array('select * from todo_list where done = "0000-00-00 00:00:00" ' . $where);
    db_execute('update todo_list set done = now() where done = "0000-00-00 00:00:00" ' . $where);
}
if (appconf('email_notices')) {
    @mail(appconf('email_notices'), 'To Do - Completed Tasks', template_simple('email_notice.spt', array('list' => $list)), 'From: noreply@' . preg_replace('/^www\\./i', '', site_domain()));
}
header('Location: /index/todo-app?pp=' . $cgi->pp . '&proj=' . $cgi->proj . '&qq=' . $cgi->qq);
exit;
Example #15
0
// your app begins here
global $cgi;
if (!empty($cgi->username) && session_admin()) {
    header('Location: ' . site_prefix() . '/index/cms-app?forward=' . urlencode($_SERVER['HTTP_REFERER']));
    exit;
} elseif (!session_valid()) {
    $action = 'login';
} elseif (!empty($cgi->username) && $cgi->remember_me == 'yes') {
    $duration = appconf('remember_login');
    if ($duration) {
        // convert duration to seconds
        $duration = $duration * 86400;
        // set "sitemember_remember" cookie
        global $cookie;
        $cookie->set('sitemember_remember', $duration, $duration, '/', site_domain(), site_secure());
        // adjust cookie
        session_change_timeout($duration);
        // adjust expires value
        session_user_edit(session_username(), array('expires' => date('Y-m-d H:i:s', time() + $duration)));
    }
    $action = 'home';
} else {
    $action = 'home';
}
if (session_valid() && !empty($parameters['goto'])) {
    header('Location: ' . $parameters['goto']);
    exit;
}
list($type, $call) = split(':', appconf($action), 2);
$func = 'loader_' . $type;
Example #16
0
<?php

/*
 * RSS Example
 *
 * This example shows how easy it is to create syndicated content for use in
 * another web site or portal.
 */
// construct an rss data structure
// this would be from a database or other resource in reality
$rss = array('title' => 'My RSS Feed', 'link' => site_url(), 'description' => 'A demonstration of an RSS news feed.', 'items' => array(array('title' => 'Test Item 1', 'link' => site_url() . site_prefix() . '/index/item1'), array('title' => 'Test Item 2', 'link' => site_url() . site_prefix() . '/index/item2'), array('title' => 'Test Item 3', 'link' => site_url() . site_prefix() . '/index/item3')));
// in the conf/properties.php file of your app, you would also want to add
// the following code to add the rss feed to the page's head, so rss-aware
// browsers will see it.  in this context, since we exit without outputting
// the global template, this code does nothing.
page_add_link('alternate', 'application/rss+xml', 'http://' . site_domain() . site_prefix() . '/index/example-rss-action');
// output the rss feed by setting the content type, displaying the rss
// template, and exiting so Sitellite doesn't render the output within
// the page body
header('Content-Type: text/xml');
echo template_simple('rss.spt', $rss);
exit;
Example #17
0
 /**
  * Constructor method.
  * 
  * @access	public
  * 
  */
 function SessionStore_PHP()
 {
     $this->cookiedomain = site_domain();
     $this->start();
 }
Example #18
0
<?php

// This is where app-level variables can be centrally stored.  This file is
// automatically included when the first call to your app is made.  Use the
// appconf_set ('name', 'value'); function to add values here.
// This is the email address to send email from in this app.
// The default is webmaster@yourdomain.com
appconf_set('email', 'webmaster@' . str_replace('www.', '', site_domain()));
// This is the default user log-in handler.
appconf_set('login', 'box:sitemember/login');
// This is the default user log-out handler.
appconf_set('logout', 'box:sitemember/logout');
// This is the default user registration handler.
// Set this to false to keep registration privately controlled.
appconf_set('register', 'form:sitemember/register');
// This is the default user home page handler.
appconf_set('home', 'box:sitemember/home');
//appconf_set ('home', 'box:sitemember/homepage');
// This is a list of member services listed on the member home pages.
// The top-level keys are 'home' and 'profile', which represent the
// two pages on which services can be registered.  The sub-arrays
// consist of a key which is the title of the service, and a value
// which is the handler itself.
//
// If you do not want a title appointed here, you may leave that value
// without a key, and it will know not to display its numeric key.
//
// This separation allows you to specify a service provided only on
// one and not the other, but also to provide separate display views
// for the user on their home page than for other visitors viewing
// that user's home page.
Example #19
0
<?php

@file(sprintf('http://www.sitellite.org/home.php?d=%s&v=%s', urlencode(site_domain()), urlencode(SITELLITE_VERSION)));
Example #20
0
// Set this to the member registration form, if you have one.
appconf_set('register', 'sitemember/register');
// Set this to the member home box, if you have one.
appconf_set('member_home', 'sitemember/home');
// Set this to the public member profile box, if you have one.
appconf_set('public_profile', 'sitemember/profile');
// Set to true for RSS links to appear in the bottom navigation links
// of the SiteLinks app.  If it is false, RSS feeds are still available
// via the /index/sitelinks-rss-action box, however they simply won't be
// linked to automatically for you.
appconf_set('rss_links', true);
// Set this to whatever you want your RSS <title> field to contain.
appconf_set('rss_title', site_domain() . ' ' . intl_get('Forum'));
// Set this to whatever you want your RSS <description> field to
// contain.
appconf_set('rss_description', intl_get('Postings from') . ' ' . site_domain());
// Set this to the template you wish to use to display the app, otherwise
// the default is used.
appconf_set('template', 'wide');
// Set this to the page ID of the page you would like to be the parent of
// your forum.  This affects the web site navigation while within the
// forum itself, and the breadcrumb trail as well.
appconf_set('page_below', false);
// Set this to the ID of the page which is an alias of the forum.
appconf_set('page_alias', false);
// Set this to the number of posts to display per screen.
appconf_set('limit', 10);
if ($context == 'action') {
    page_add_link('alternate', 'application/rss+xml', site_url() . '/index/siteforum-rss-action');
    if (appconf('page_below')) {
        page_below(appconf('page_below'));
Example #21
0
/**
 * Corrects the specified file name (aka URL) by checking if it is
 * a path or a complete URL.  Returns a complete URL either way.
 *
 * @param string
 * @return string
 */
function htmldoc_verify_filename($file)
{
    if (strpos($file, '/') === 0) {
        return 'http://' . site_domain() . site_prefix() . $file;
    }
    return $file;
}
Example #22
0
if ($parameters['collection'] != 'sitefaq_submission') {
    return;
}
switch ($parameters['action']) {
    case 'modify':
        /* For this collection, since it doesn't support versioning,
         * the action will always be 'modify'.
         */
        if ($parameters['data']['sitellite_status'] == 'approved') {
            if (conf('App', 'sitefaq', 'user_anonymity')) {
                $parameters['data']['email'] = db_shift('select email from sitefaq_submission
					where id = ?', $parameters['data']['id']);
            }
            if (!empty($parameters['data']['email'])) {
                // reply to user
                @mail($parameters['data']['email'], intl_get('FAQ Response'), template_simple('email_answer.spt', $parameters['data']), 'From: faq@' . str_replace('www.', '', site_domain()));
            }
            if (conf('App', 'sitefaq', 'user_anonymity')) {
                // erase user's contact info
                loader_import('cms.Versioning.Rex');
                $rex = new Rex('sitefaq_submission');
                $rex->modify($parameters['data'][$rex->key], array('name' => '', 'email' => '', 'url' => '', 'ip' => '', 'member_id' => ''));
            }
        }
        break;
    case 'replace':
        break;
    case 'republish':
        break;
    case 'update':
        break;
Example #23
0
    }
    if (!empty($parameters['path'])) {
        $parameters['path'] .= '/';
    }
    foreach (array_keys($res) as $k) {
        if (empty($res[$k]->name)) {
            // skip dot-files (empty files will only have extensions
            unset($res[$k]);
            continue;
        }
        if (empty($res[$k]->display_title)) {
            $res[$k]->display_title = $res[$k]->name;
        }
    }
    // show an auto-discovery rss link to this directory listing as well
    page_add_link('alternate', 'application/rss+xml', 'http://' . site_domain() . site_prefix() . '/index/cms-filesystem-rss-action?path=' . urlencode(trim($parameters['path'], '/')));
    echo template_simple('filesystem_list.spt', array('path' => $parameters['path'], 'list' => $res, 'show' => $show));
    return;
}
if (strpos($parameters['file'], '/') === 0) {
    $parameters['file'] = substr($parameters['file'], 1);
}
$parameters['file'] = strtolower($parameters['file']);
$info = pathinfo($parameters['file']);
if ($info['dirname'] == '.') {
    $info['dirname'] = '';
}
if (!$info['extension']) {
    $info['extension'] = '';
}
$info['basename'] = preg_replace('/\\.' . preg_quote($info['extension'], '/') . '$/', '', $info['basename']);
Example #24
0
 function onSubmit($vals)
 {
     //info ($vals);
     //return;
     if ($vals['salutation'] == '- SELECT -') {
         unset($vals['salutation']);
     }
     if ($vals['gender'] == '- SELECT -') {
         unset($vals['gender']);
     }
     if ($vals['state'] == '- SELECT -') {
         unset($vals['state']);
     }
     if ($vals['country'] == '- SELECT -') {
         unset($vals['country']);
     }
     if ($vals['preferred_method_of_contact'] == '- SELECT -') {
         unset($vals['preferred_method_of_contact']);
     }
     if ($vals['best_time'] == '- SELECT -') {
         unset($vals['best_time']);
     }
     if ($vals['may_we_contact_you'] == '- SELECT -') {
         unset($vals['may_we_contact_you']);
     }
     if ($this->parameters['save'] == 'yes') {
         // save to sitellite_form_submission table
         db_execute('insert into sitellite_form_submission values (null, ?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $this->parameters['form_type'], $this->parameters['title'], $_SERVER['REMOTE_ADDR'], $vals['account_number'], $vals['pass_phrase'], $vals['salutation'], $vals['first_name'], $vals['last_name'], $vals['email_address'], $vals['birthday'], $vals['gender'], $vals['address_line1'], $vals['address_line2'], $vals['city'], $vals['state'], $vals['country'], $vals['zip'], $vals['company'], $vals['job_title'], $vals['phone_number'], $vals['daytime_phone'], $vals['evening_phone'], $vals['mobile_phone'], $vals['fax_number'], $vals['preferred_method_of_contact'], $vals['best_time'], $vals['may_we_contact_you'], $vals['comments']);
     }
     if ($this->parameters['cc'] == 'yes' || $vals['cc'] == 'yes') {
         $cc = "\r\nCC: " . $vals['email_address'];
     } else {
         $cc = '';
     }
     if (!@mail($this->parameters['email'], '[' . site_domain() . '] ' . $this->parameters['title'], template_simple('util_custom_email.spt', $vals), 'From: ' . $vals['first_name'] . ' ' . $vals['last_name'] . ' <' . $vals['email_address'] . '>' . $cc)) {
         page_title(intl_get('An Error Occurred'));
         echo '<p>' . intl_get('Our apologies, your form failed to be submitted.  Please try again later.') . '</p>';
         return;
     }
     if ($this->parameters['context'] == 'action') {
         page_title(intl_get('Thank You'));
     } else {
         echo '<h1>' . intl_get('Thank You') . '</h1>';
     }
     echo template_simple('util_custom_thanks.spt');
 }
Example #25
0
 function isPage($link)
 {
     if (strpos($link, 'cms-filesystem-action') !== false) {
         return false;
     }
     if (!conf('Site', 'remove_index')) {
         if (strpos($link, site_prefix() . '/index') === false) {
             return false;
         }
     } else {
         if (strpos($link, site_prefix() . '/') === false) {
             return false;
         }
     }
     $parts = parse_url($link);
     $page = basename($parts['path']);
     if (!empty($parts['host']) && $parts['host'] != site_domain()) {
         return false;
     }
     if (empty($page)) {
         return 'index';
     }
     $strlen = strlen($page);
     if ($strlen > 7 && better_strrpos($page, '-action') == $strlen - 7) {
         return false;
     } elseif ($strlen > 5 && better_strrpos($page, '-form') == $strlen - 5) {
         return false;
     } elseif ($strlen > 4 && better_strrpos($page, '-app') == $strlen - 4) {
         return false;
     }
     return $page;
 }
Example #26
0
//	(! empty ($cgi->username) && ! empty ($cgi->password)) ||
//	! empty ($cookie->{$_sconf['Handler']['cookiename']})
//	) {
$sources = array();
foreach ($_sconf as $k => $v) {
    if (strpos($k, 'Source ') === 0) {
        $sources[$v['driver']] = $v;
    }
}
list($user, $pass, $id) = @Session::gatherParameters($_sconf['Handler']['driver'], $_sconf['Handler']['cookiename']);
$session = new Session($_sconf['Handler']['driver'], array_keys($sources), $_sconf['Store']['driver'], $user, $pass, $id);
$session->init($_sconf['Session']['path']);
$session->setTimeout($_sconf['Session']['timeout']);
foreach ($sources as $k => $v) {
    $session->setSourceProperties($k, $v);
}
$session->setHandlerProperties($_sconf['Handler']);
$session->setStoreProperties($_sconf['Store']);
if ($_sconf['Handler']['driver'] == 'Cookie' && $conf['Site']['secure']) {
    $session->handler->cookiesecure = true;
    $session->store->cookiesecure = 1;
}
if (!empty($cgi->username) || !empty($cookie->{$_sconf['Handler']['cookiename']})) {
    if ($cookie->sitemember_remember > 0) {
        $session->handler->cookieexpires = $cookie->sitemember_remember;
        $session->setTimeout($cookie->sitemember_remember);
        $cookie->set('sitemember_remember', $cookie->sitemember_remember, $cookie->sitemember_remember, '/', site_domain(), site_secure());
    }
    $session->start();
}
//} // end evaluation condition
Example #27
0
if (!isset($parameters['limit'])) {
    $parameters['limit'] = 50;
}
$e = new SiteEvent_Event();
$list = $e->getUpcoming($parameters['limit'], $parameters['category'], $parameters['audience']);
$cal = new vCal();
$cal->addProperty('METHOD', 'PUBLISH');
$cal->addProperty('CALSCALE', 'GREGORIAN');
$cal->addProperty('PRODID', '-//SIMIAN systems//NONSGML SiteEvent//EN');
$cal->addProperty('VERSION', '2.0');
foreach (array_keys($list) as $k) {
    $item =& $list[$k];
    $e =& $cal->addEvent('VEVENT');
    $e->addProperty('UID', site_domain() . '/siteevent/' . $item->id);
    $e->addProperty('SEQUENCE', $k + 1);
    $p =& $e->addProperty('URL', 'http://' . site_domain() . site_prefix() . '/index/siteevent-details-action/id.' . $item->id . '/title.' . siteevent_filter_link_title($item->title));
    $p->addParameter('VALUE', 'URI');
    $e->addProperty('STATUS', 'CONFIRMED');
    if ($item->time && $item->time > '00:00:00') {
        $e->addProperty('DTSTART', Date::timestamp($item->date . ' ' . $item->time, 'Ymd\\THis'));
    } else {
        $p =& $e->addProperty('DTSTART', Date::format($item->date, 'Ymd'));
        $p->addParameter('VALUE', 'DATE');
    }
    if ($item->until_date && $item->until_date > '0000-00-00') {
        if ($item->until_time && $item->until_time > '00:00:00') {
            $e->addProperty('DTEND', Date::timestamp($item->until_date . ' ' . $item->until_time, 'Ymd\\THis'));
        } else {
            $p =& $e->addProperty('DTEND', Date::format($item->until_date, 'Ymd'));
            $p->addParameter('VALUE', 'DATE');
        }
Example #28
0
<?php

// Results per screen
appconf_set('limit', 10);
// Set to true for RSS links to appear in the bottom navigation links
// of the SiteLinks app.  If it is false, RSS feeds are still available
// via the /index/sitelinks-rss-action box, however they simply won't be
// linked to automatically for you.
appconf_set('rss_links', true);
// Set this to whatever you want your RSS <title> field to contain.
appconf_set('rss_title', site_domain() . ' ' . intl_get('Search'));
// Set this to whatever you want your RSS <description> field to
// contain.
appconf_set('rss_description', intl_get('Search results from') . ' ' . site_domain());
appconf_set('date_format', 'F d, Y \\a\\t g:ia');
appconf_set('date_short', 'F d, Y');
appconf_set('date_month', 'F, Y');
appconf_set('date_year', 'Y');
appconf_set('time_format', 'g:ia');
Example #29
0
 /**
  * Checks for an $external property of the document object, which if found
  * is understood to represent an external document that this object is
  * actually an alias of, and so it will forward the request on to that
  * document.
  */
 function isExternal()
 {
     if (!empty($this->external)) {
         global $intl;
         if ($intl->negotiation == 'url') {
             $intl_prefix = '/' . $intl->language;
         } else {
             $intl_prefix = '';
         }
         if (conf('Site', 'remove_index')) {
             $index = '/';
         } else {
             $index = '/index/';
         }
         if (session_admin()) {
             if (!preg_match('|^[a-zA-Z0-9]+://|', $this->external)) {
                 if (strpos($this->external, '/') === 0) {
                     if (site_secure() && cgi_is_https()) {
                         $ext = 'https://' . site_domain() . $this->external;
                     } else {
                         $ext = 'http://' . site_domain() . $this->external;
                     }
                 } else {
                     if (site_secure() && cgi_is_https()) {
                         $ext = 'https://' . site_domain() . site_prefix() . $intl_prefix . $index . $this->external;
                     } else {
                         $ext = 'http://' . site_domain() . site_prefix() . $intl_prefix . $index . $this->external;
                     }
                 }
             } else {
                 $ext = $this->external;
             }
             $this->body = '<p>' . intl_get('This page is a placeholder for the following external resource') . ':</p><p><a href="' . $ext . '">' . $ext . '</a></p>';
             return false;
         }
         if (!preg_match('|^[a-zA-Z0-9]+://|', $this->external)) {
             if (strpos($this->external, '/') === 0) {
                 if (site_secure() && cgi_is_https()) {
                     header('Location: https://' . site_domain() . $this->external);
                 } else {
                     header('Location: http://' . site_domain() . $this->external);
                 }
             } else {
                 if (site_secure() && cgi_is_https()) {
                     header('Location: https://' . site_domain() . site_prefix() . $intl_prefix . $index . $this->external);
                 } else {
                     header('Location: http://' . site_domain() . site_prefix() . $intl_prefix . $index . $this->external);
                 }
             }
         } else {
             header('Location: ' . $this->external);
         }
         exit;
     }
 }