~budgester/irm/trunk

« back to all changes in this revision

Viewing changes to include/setup.functions.php

  • Committer: budgester at budgester
  • Date: 2008-03-05 23:14:13 UTC
  • Revision ID: budgester@budgester.com-20080305231413-k5vqfuckfo09ju42
Initial import of IRM codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
#    IRM - The Information Resource Manager
 
3
#    Copyright (C) 2005 Martin Stevens 
 
4
#
 
5
#    This program is free software; you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License as published by
 
7
#    the Free Software Foundation; either version 2 of the License, or
 
8
#    (at your option) any later version.
 
9
#
 
10
#    This program is distributed in the hope that it will be useful,
 
11
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
#    GNU General Public License (in file COPYING) for more details.
 
14
#
 
15
#    You should have received a copy of the GNU General Public License
 
16
#    along with this program; if not, write to the Free Software
 
17
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 
 
19
function prefsUpdate()
 
20
{
 
21
        $DB = Config::Database();
 
22
        $user = $DB->getTextValue($_POST['user']);
 
23
 
 
24
        $user_obj = new User();
 
25
        $user_obj->setName($_POST['user']);
 
26
        $user_obj->initPrefs();
 
27
 
 
28
        $DB->UpdateQuery('prefs', $_POST, "user=$user");
 
29
}
 
30
 
 
31
function setupLookup()
 
32
{
 
33
        AuthCheck("tech");
 
34
        $lookupId = $_POST['lookupId'];
 
35
        $value = $_POST['value'];
 
36
        $action = $_POST['action'];
 
37
 
 
38
        $lookup = new Lookup($lookupId);
 
39
 
 
40
        switch($action)
 
41
        {
 
42
                case "add":
 
43
                        $lookup->addValue($value);
 
44
                        break;
 
45
                case "delete":
 
46
                        $lookup->deleteValue($value);
 
47
                        break;
 
48
                case "newlookup":
 
49
                        $lookup->addLookup($_REQUEST['lookupId'],$_REQUEST['lookupName'],$_REQUEST['lookupDescription']);
 
50
                        break;
 
51
        }
 
52
        logevent(-1, _("IRM"), 5, _("setup"), sprintf(_("%s %s entry %s from %s."),$IRMName,$action,$value,$lookupId));
 
53
}
 
54
?>