Beispiel #1
0
<?php

loader_import('saf.Misc.RPC');
class Xed_RPC
{
    function cleaners($ifname, $data)
    {
        loader_import('xed.Cleaners');
        return array($ifname, the_cleaners($data));
    }
}
echo rpc_handle(new Xed_RPC(), $parameters);
exit;
Beispiel #2
0
            if (!is_array($list)) {
                $list = array();
            }
            if (!in_array($foreign_id, $list)) {
                $list[] = $foreign_id;
            }
            session_set($name . '_joiner', $list);
            return true;
        }
        return db_execute(sprintf('insert into %s (%s, %s) values (?, ?)', $table, $field1, $field2), $primary_id, $foreign_id);
    }
    function remove($name, $primary_id, $foreign_id, $table, $field1, $field2)
    {
        if (!$primary_id || $primary_id == 'false') {
            $list = session_get($name . '_joiner');
            if (!is_array($list)) {
                $list = array();
            }
            foreach ($list as $k => $v) {
                if ($v == $foreign_id) {
                    unset($list[$k]);
                }
            }
            session_set($name . '_joiner', $list);
            return true;
        }
        return db_execute(sprintf('delete from %s where %s = ? and %s = ?', $table, $field1, $field2), $primary_id, $foreign_id);
    }
}
echo rpc_handle(new Joiner_RPC(), $parameters);
exit;
Beispiel #3
0
<?php

if ($context == 'action') {
    loader_import('saf.Misc.RPC');
    class CMS_Browse_Level
    {
        function toggle()
        {
            // switch browse level
            if (session_pref('browse_level') == 'normal') {
                session_pref_set('browse_level', 'advanced');
            } else {
                session_pref_set('browse_level', 'normal');
            }
            return true;
        }
    }
    echo rpc_handle(new CMS_Browse_Level(), $parameters);
    exit;
    // return to whence they came
    //header ('Location: ' . $_SERVER['HTTP_REFERER']);
    //exit;
}
// show their browse level and the switch link
page_add_script(site_prefix() . '/js/rpc.js');
echo template_simple('user_preferences_level.spt');
Beispiel #4
0
<?php

loader_import('saf.Misc.RPC');
loader_import('wffolderbrowser.PageBrowser');
echo rpc_handle(new PageBrowser(), $parameters);
exit;
Beispiel #5
0
<?php

loader_import('saf.Misc.RPC');
loader_import('saf.MailForm.Autosave');
echo rpc_handle(new Autosave(), $parameters);
exit;
Beispiel #6
0
<?php

loader_import('saf.Misc.RPC');
class Digger
{
    function vote($score, $id)
    {
        $ip = $_SERVER['REMOTE_ADDR'];
        $user = session_username();
        if (!$user) {
            $user = '******';
        }
        if ($score == 'yes') {
            db_execute('UPDATE digger_linkstory SET score = score + 1 WHERE id = ?', $id);
            db_execute('INSERT INTO digger_vote (id, story, score, user, ip, votetime) VALUES (null, ?, 1, ?, ?, NOW())', $id, $user, $ip);
        } else {
            db_execute('UPDATE digger_linkstory SET score=score-1 WHERE id = ?', $id);
            db_execute('INSERT INTO digger_vote (id, story, score, user, ip, votetime) VALUES (null, ?, -1, ?, ?, NOW())', $id, $user, $ip);
            $score = db_shift('select score from digger_linkstory where id = ?', $id);
            if ($score <= appconf('ban_threshold')) {
                db_execute('update digger_linkstory set status = "disabled" where id = ?', $id);
            }
        }
        return true;
    }
}
echo rpc_handle(new Digger(), $parameters);
exit;
Beispiel #7
0
<?php

loader_import('saf.Misc.RPC');
loader_import('sitetemplate.Functions');
class SiteTemplate_RPC_Handler
{
    function getBoxes($app)
    {
        return sitetemplate_get_boxes($app);
    }
}
echo rpc_handle(new SiteTemplate_RPC_Handler(), $parameters);
exit;