Example #1
0
 /**
  * show and search log events
  */
 function show_action()
 {
     $this->action_id = Request::option('action_id');
     $this->object_id = Request::option('object_id');
     $this->log_actions = $this->event_log->get_used_log_actions();
     $this->types = $this->event_log->get_object_types();
     // restrict log events to object scope
     if (Request::get('search') && Request::get('search') != '') {
         $this->type = Request::get('type');
         $this->search = Request::get('search');
         $objects = $this->event_log->find_objects($this->type, $this->search, $this->action_id);
         if (count($objects) > 0) {
             $this->objects = $objects;
         } else {
             $this->error_msg = _('Kein passendes Objekt gefunden.');
         }
     }
     // find all matching log events
     if (Request::get('search') === '' || isset($this->object_id)) {
         $this->start = (int) Request::int('start');
         $this->format = Request::quoted('format');
         $this->num_entries = $this->event_log->count_log_events($this->action_id, $this->object_id);
         if (Request::get('back') || Request::submitted('back')) {
             $this->start = max(0, $this->start - 50);
         } else {
             if (Request::get('forward') || Request::submitted('forward')) {
                 $this->start = min($this->num_entries, $this->start + 50);
             }
         }
         $this->log_events = $this->event_log->get_log_events($this->action_id, $this->object_id, $this->start);
     }
 }
Example #2
0
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->ELEARNING_INTERFACE_ENABLE) {
         throw new AccessDeniedException(_('Elearning-Interface ist nicht aktiviert.'));
     } else {
         $this->elearning_active = true;
     }
     PageLayout::setHelpKeyword('Basis.Ilias');
     PageLayout::setTitle($_SESSION['SessSemName']["header_line"] . " - " . _("Lernmodule"));
     checkObject();
     // do we have an open object?
     checkObjectModule('elearning_interface');
     object_set_visit_module('elearning_interface');
     $this->search_key = Request::get('search_key');
     $GLOBALS['search_key'] = $this->search_key;
     $this->cms_select = Request::quoted('cms_select');
     $GLOBALS['cms_select'] = $this->cms_select;
     $this->open_all = Request::get('open_all');
     $this->close_all = Request::get('close_all');
     $this->new_account_cms = Request::get('new_account_cms');
     $this->module_system_type = Request::get('module_system_type');
     $this->module_id = Request::get('module_id');
     $this->module_type = Request::get('module_type');
     $this->anker_target = Request::get('anker_target');
     $this->seminar_id = $_SESSION['SessSemName'][1];
     $this->rechte = $GLOBALS['perm']->have_studip_perm('tutor', $this->seminar_id);
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->new_account_cms])) {
         unset($this->new_account_cms);
     }
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_select])) {
         unset($this->cms_select);
     }
     if ($this->seminar_id != $_SESSION['elearning_open_close']["id"]) {
         unset($_SESSION['cache_data']);
         unset($_SESSION['elearning_open_close']);
     }
     if ($this->open_all != "") {
         $_SESSION['elearning_open_close']["all open"] = true;
     } elseif ($this->close_all != "") {
         $_SESSION['elearning_open_close']["all open"] = "";
     }
     $_SESSION['elearning_open_close']["type"] = "seminar";
     $_SESSION['elearning_open_close']["id"] = $this->seminar_id;
     if (Request::get('do_open')) {
         $this->anker_target = Request::get('do_open');
         $_SESSION['elearning_open_close'][Request::get('do_open')] = true;
     } elseif (Request::get('do_close')) {
         $this->anker_target = Request::get('do_close');
         $_SESSION['elearning_open_close'][Request::get('do_close')] = false;
     }
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/learnmodule-sidebar.png');
     $this->sidebar->setContextAvatar(CourseAvatar::getAvatar($this->seminar_id));
 }
Example #3
0
 public function testStringParam()
 {
     $this->assertNull(Request::get('null'));
     $this->assertSame(Request::get('null', 'foo'), 'foo');
     $this->assertSame(Request::get('a'), 'test');
     $this->assertSame(Request::get('b'), '\\h1"');
     $this->assertSame(Request::get('c'), '-23');
     $this->assertSame(Request::get('d'), '12.7');
     $this->assertNull(Request::get('v2'));
     $this->assertNull(Request::quoted('null'));
     $this->assertSame(Request::quoted('null', 'foo'), 'foo');
     $this->assertSame(Request::quoted('b'), '\\\\h1\\"');
     $this->assertNull(Request::quoted('v2'));
 }
Example #4
0
function print_lit_import_dlg()
{
    global $username, $_range_id, $plugin_name, $LIT_IMPORT_PLUGINS;
    $plugin_name = Request::quoted('plugin_name');
    if (!$plugin_name) {
        $plugin_name = "EndNote";
    }
    $plugin = array();
    if ($plugin_name) {
        foreach ($LIT_IMPORT_PLUGINS as $p) {
            if ($p["name"] == $plugin_name) {
                $plugin = $p;
                break;
            }
        }
    }
    $template = $GLOBALS['template_factory']->open('literatur/import_lit_list');
    $template->set_attribute('plugin_name', $plugin_name);
    $template->set_attribute('plugin', $plugin);
    $template->set_attribute('_range_id', $_range_id);
    $template->set_attribute('username', Request::quoted('username'));
    echo $template->render();
}
 function index_action()
 {
     if (!$GLOBALS['perm']->have_perm("admin")) {
         throw new AccessDeniedException(_("Sie sind nicht berechtigt, dieses Plugin zu benutzen."));
     }
     $db = DBManager::get();
     if (Request::submitted('do_search_source')) {
         $result = search_range(Request::quoted('search_source'));
         if (is_array($result)) {
             $result = array_filter($result, function ($r) {
                 return $r["type"] == "sem";
             });
             if (count($result)) {
                 PageLayout::postMessage(MessageBox::success(sprintf(_("Ihre Sucher ergab %s Treffer."), count($result))));
                 $show_source_result = true;
             }
         } else {
             PageLayout::postMessage(MessageBox::info(_("Ihre Suche ergab keine Treffer.")));
         }
     }
     if (Request::submitted('do_choose_source')) {
         $source_id = Request::option('search_source_result');
         $copy_count = 5;
         Request::set('to_copy', null);
     } else {
         if (Request::submitted('source_id')) {
             $source_id = Request::option('source_id');
             $copy_count = Request::int('copy_count');
             if ($copy_count < 1) {
                 $copy_count = 1;
             }
         }
     }
     if ($source_id) {
         $source = Seminar::getInstance($source_id);
         $source_name = $source->getName() . ' (' . $source->getStartSemesterName() . ')';
         $copy_type = Request::int('copy_type', $source->status);
         if (SeminarCategories::getByTypeId($copy_type)->course_creation_forbidden) {
             $copy_type = 0;
         }
         if (SeminarCategories::getByTypeId($source->status)->only_inst_user) {
             $search_template = "user_inst";
         } else {
             $search_template = "user";
         }
         $bet_inst = $db->query("SELECT institut_id FROM seminar_inst WHERE seminar_id=" . $db->quote($source_id))->fetchAll(PDO::FETCH_COLUMN);
         $source_dozenten = array_keys($source->getMembers('dozent'));
         if ($copy_count) {
             $r = Request::getArray('to_copy');
             $delete_lecturer = Request::getArray('delete_lecturer');
             $add_lecturer = count(Request::getArray('add_lecturer')) ? (int) key(Request::getArray('add_lecturer')) : null;
             for ($i = 0; $i < $copy_count; $i++) {
                 $to_copy['nr'][$i] = isset($r['nr'][$i]) ? $r['nr'][$i] : $source->getNumber();
                 $to_copy['name'][$i] = isset($r['name'][$i]) ? $r['name'][$i] : $source->getName();
                 $to_copy['participants'][$i] = isset($r['participants'][$i]) ? 1 : 0;
                 $to_copy['lecturers'][$i] = $r['lecturers'][$i];
                 if (empty($to_copy['lecturers'][$i])) {
                     $to_copy['lecturers'][$i] = $source_dozenten;
                 } else {
                     if (isset($delete_lecturer[$i]) && count($to_copy['lecturers'][$i]) > 1) {
                         $to_delete = array_search(key($delete_lecturer[$i]), $to_copy['lecturers'][$i]);
                         if ($to_delete !== false) {
                             unset($to_copy['lecturers'][$i][$to_delete]);
                         }
                     }
                 }
                 if ($add_lecturer === $i && Request::option('add_doz_' . $add_lecturer)) {
                     $to_copy['lecturers'][$i][] = Request::option('add_doz_' . $add_lecturer);
                 }
                 $to_copy['search_lecturer'][$i] = new PermissionSearch($search_template, sprintf(_("%s auswählen"), get_title_for_status('dozent', 1, $source->status)), "user_id", array('permission' => 'dozent', 'exclude_user' => $to_copy['lecturers'][$i], 'institute' => $bet_inst));
             }
         }
         if (Request::submitted('do_copy') && count($to_copy)) {
             $copied = array();
             $lecturer_insert = $db->prepare("INSERT INTO seminar_user (seminar_id,user_id,status,position,gruppe,comment,visible,mkdate) VALUES (?,?,'dozent',?,?,'','yes',UNIX_TIMESTAMP())");
             $copy_seminar_inst = $db->prepare("INSERT INTO seminar_inst (seminar_id,institut_id) SELECT ?,institut_id FROM seminar_inst WHERE seminar_id=?");
             $copy_seminar_sem_tree = $db->prepare("INSERT INTO seminar_sem_tree (seminar_id,sem_tree_id) SELECT ?,sem_tree_id FROM seminar_sem_tree WHERE seminar_id=?");
             $copy_seminar_user = $db->prepare("INSERT IGNORE INTO seminar_user (seminar_id,user_id,status,gruppe, mkdate,comment,position) SELECT ?,user_id,status,gruppe,UNIX_TIMESTAMP(),'',0 FROM seminar_user WHERE status IN ('user','autor','tutor') AND seminar_id=?");
             $copy_seminar_userdomains = $db->prepare("INSERT INTO seminar_userdomains (seminar_id,userdomain_id) SELECT ?,userdomain_id FROM seminar_userdomains WHERE seminar_id=?");
             $copy_statusgruppen = $db->prepare("INSERT INTO statusgruppen (statusgruppe_id,name,range_id,position,size,selfassign,mkdate) SELECT MD5(CONCAT(statusgruppe_id, ?)),name,?,position,size,selfassign,UNIX_TIMESTAMP() FROM statusgruppen WHERE range_id=?");
             $copy_statusgruppe_user = $db->prepare("INSERT INTO statusgruppe_user (statusgruppe_id,user_id,position) SELECT MD5(CONCAT(statusgruppe_user.statusgruppe_id, ?)),user_id,statusgruppe_user.position FROM statusgruppen INNER JOIN statusgruppe_user USING(statusgruppe_id) WHERE range_id=?");
             for ($i = 0; $i < $copy_count; $i++) {
                 $new_sem = Course::build($source->toArray());
                 $new_sem->setId($new_sem->getNewId());
                 $new_sem_id = $new_sem->id;
                 $new_sem->status = Request::int('copy_type', 1);
                 $new_sem->name = $to_copy['name'][$i];
                 $new_sem->veranstaltungsnummer = $to_copy['nr'][$i];
                 $new_sem->store();
                 if (!$new_sem->isNew()) {
                     log_event("SEM_CREATE", $new_sem_id);
                     $gruppe = (int) select_group($new_sem->start_time);
                     $position = 1;
                     foreach ($to_copy['lecturers'][$i] as $lecturer) {
                         $lecturer_insert->execute(array($new_sem_id, $lecturer, $position, $gruppe));
                     }
                     $copy_seminar_inst->execute(array($new_sem_id, $source_id));
                     $copy_seminar_sem_tree->execute(array($new_sem_id, $source_id));
                     $copy_seminar_userdomains->execute(array($new_sem_id, $source_id));
                     if ($to_copy['participants'][$i]) {
                         $copy_seminar_user->execute(array($new_sem_id, $source_id));
                         $copy_statusgruppen->execute(array($new_sem_id, $new_sem_id, $source_id));
                         $copy_statusgruppe_user->execute(array($new_sem_id, $source_id));
                     }
                     $copied[] = $new_sem;
                 }
             }
             PageLayout::postMessage(MessageBox::success(sprintf(_("Es wurden %s Kopien erstellt."), count($copied))));
             $source_id = null;
         }
     }
     PageLayout::setTitle(_("Veranstaltungs-Vervielfältiger"));
     $template_factory = new Flexi_TemplateFactory(dirname(__FILE__) . "/templates");
     $template = $template_factory->open('index.php');
     $template->set_layout($GLOBALS['template_factory']->open('layouts/base.php'));
     echo $template->render(compact('source_id', 'source_name', 'show_source_result', 'result', 'copy_count', 'copy_type', 'to_copy', 'copied'));
 }
Example #6
0
// +---------------------------------------------------------------------------+

require '../lib/bootstrap.php';

ob_start();
page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Default_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"));

$o_mode = Request::option('o_mode');
$xml_file_id = Request::option('xml_file_id',"");
$xslt_filename = Request::quoted('xslt_filename');
$page = Request::option('page');
$filter = Request::option('filter');
$ex_type = Request::quoted('ex_type');
$ex_sem = Request::option('ex_sem');
$format = Request::option('format');
$choose = Request::quoted('choose');
$range_id = Request::option('range_id');

$sidebar = Sidebar::Get();
$sidebar->setImage('sidebar/export-sidebar.png');

if (($o_mode != "direct") AND ($o_mode != "passthrough"))
{
    $perm->check("tutor");
    include ('lib/seminar_open.php'); // initialise Stud.IP-Session
}

//$i_page = "my_courses.php";
//$EXPORT_ENABLE = TRUE;
//$PATH_EXPORT = "export";
// -- here you have to put initialisations for the current page
Example #7
0
 function checkData()
 {
     global $invalidEntries;
     // check the standard role data
     if (!Request::get('new_name') && Request::get('presetName') != 'none') {
         $this->name = remove_magic_quotes(Request::get('presetName'));
     } else {
         $this->name = remove_magic_quotes(Request::get('new_name'));
     }
     $this->size = (int) Request::int('new_size');
     // check if we have to remove the self_assign_exclusive-flag
     $this->selfassign = SetSelfAssign($this->statusgruppe_id, Request::quoted('new_selfassign') ? 1 : 0);
     /*if (Request::quoted('new_selfassign')) {
           if ($this->selfassign == 0) {
               $this->selfassign = 1;
           }
       } else {
           if ($this->selfassign == 2) {
               if ($GLOBALS['SessSemName']) {
                   SetSelfAssignExclusive($GLOBALS['SessSemName'][1], false);
               }
           }
           $this->selfassign = 0;
       }*/
     if (Request::get('groupfolder')) {
         // check if there already exists a folder
         $stmt = DBManager::get()->prepare("SELECT COUNT(*) as c FROM folder WHERE range_id = ?");
         $stmt->execute(array($this->statusgruppe_id));
         if ($folder = $stmt->fetch(PDO::FETCH_ASSOC)) {
             if ($folder['c'] == 0) {
                 // if no folder exists, we create one
                 $title = _("Dateiordner der Gruppe:") . ' ' . $this->name;
                 $description = _("Ablage für Ordner und Dokumente dieser Gruppe");
                 $permission = 15;
                 create_folder(addslashes($title), $description, $this->statusgruppe_id, $permission);
                 $this->messages['msg'][] = _("Es wurde ein Gruppenordner angelegt.");
             }
         }
     }
     if (!$this->isSeminar()) {
         // check the datafields
         foreach (Request::quotedArray('datafields') as $id => $data) {
             $struct = DataField::find($id);
             $entry = DataFieldEntry::createDataFieldEntry($struct, array($this->range_id, $this->statusgruppe_id));
             $entry->setValueFromSubmit($data);
             if ($entry->isValid()) {
                 $entry->store();
             } else {
                 $invalidEntries[$struct->id] = $entry;
             }
         }
         // a group cannot be its own vather!
         if (Request::get('vather') == $this->statusgruppe_id) {
             $this->messages['error'][] = _("Sie könne diese Gruppe nicht sich selbst unterordnen!");
         } else {
             // check if the group shall be moved
             if (Request::get('vather') != 'nochange') {
                 if (Request::option('vather') == 'root') {
                     $vather_id = $GLOBALS['range_id'];
                 } else {
                     $vather_id = Request::option('vather');
                 }
                 if (!isVatherDaughterRelation($this->statusgruppe_id, $vather_id)) {
                     $this->range_id = $vather_id;
                     //$db->query("UPDATE statusgruppen SET range_id = '$vather_id' WHERE statusgruppe_id = '{$this->statusgruppe_id}'");
                 } else {
                     $this->messages['error'][] = _("Sie können diese Gruppe nicht einer ihr untergeordneten Gruppe zuweisen!");
                 }
             }
         }
     }
     if (!$this->isSeminar() && is_array($invalidEntries)) {
         $this->messages['error'][] = _("Korrigieren Sie die fehlerhaften Eingaben!");
         return false;
     }
     return true;
 }
 function getContent ($args) {
     global $_fullname_sql;
     
     $content = array();
     $dbv = DbView::getView('literatur');
     if (is_array($args) && isset($args['user_id'])) {
         $tree = TreeAbstract::GetInstance("StudipLitList", $args['user_id']);
     } else {
         preg_match(':^([a-z_-]{0,50})$:i', Request::quoted('username'), $matches);
         $tree = TreeAbstract::GetInstance("StudipLitList", get_userid($matches[1]));
     }
     if ($lists = $tree->getVisibleListIds()) {
         for ($i = 0; $i < count($lists); ++$i) {
             if ($this->config->getValue($this->name, 'showlastchange')) {
 //          && ($tree->tree_data[$lists[$i]]['chdate'] > $last_modified_since) ){
                 $content['LITLISTS']['LITLIST'][$i]['LITLIST_CHANGE-DATE'] = strftime($this->config->getValue('Main', 'dateformat'),
                         $tree->tree_data[$lists[$i]]['chdate']);
                 $content['LITLISTS']['LITLIST'][$i]['LITLIST_FULLNAME'] = $tree->tree_data[$lists[$i]]['fullname'];
                 $content['LITLISTS']['LITLIST'][$i]['LITLIST_NAME'] = $tree->tree_data[$lists[$i]]['name'];
             } else {
                 $content['LITLISTS']['LITLIST'][$i]['LITLIST_NAME'] = $tree->tree_data[$lists[$i]]['name'];
             }
             if ($tree->hasKids($lists[$i])){
                 $dbv->params[0] = $lists[$i];
                 $rs = $dbv->get_query("view:LIT_LIST_GET_ELEMENTS");
                 $j = 0;
                 while ($rs->next_record()){
                     if ( ($this->config->getValue($this->name, 'showlastchange'))) {
             //      && ($tree->tree_data[$rs->f('list_element_id')]['chdate'] > $last_modified_since) ){
                         $content['LITLISTS']['LITLIST'][$i]['LITLIST_ITEM'][$j]['LITLIST_ITEM_CHANGE-DATE'] = strftime($this->config->getValue('Main', 'dateformat'),
                                 $tree->tree_data[$rs->f('list_element_id')]['chdate']);
                         $content['LITLISTS']['LITLIST'][$i]['LITLIST_ITEM'][$j]['LITLIST_ITEM_FULLNAME'] = $tree->tree_data[$rs->f('list_element_id')]['fullname'];
                     }
                     $content['LITLISTS']['LITLIST'][$i]['LITLIST_ITEM'][$j]['LITLIST_ITEM_ELEMENT'] = ExternModule::ExtFormatReady($tree->getFormattedEntry($rs->f('list_element_id'), $rs->Record));
                     $j++;
                 }
             }
         }
     }
     
     return $content;
 }
    $_SESSION['_lit_data_id'] = Request::option('_lit_data_id');
}
$_check_list = Request::optionArray('_check_list');
if (!empty($_check_list)) {
    $_SESSION['_check_list'] = Request::optionArray('_check_list');
}
if (Request::option('_check_plugin')) {
    $_SESSION['_check_plugin'] = Request::option('_check_plugin');
}
$_semester = new SemesterData();
$element = new StudipLitCatElement();
if (Request::option('cmd') == 'check' && !isset($_check_list)) {
    Request::set('_check_list', array());
}
//my_session_var(array('_semester_id','_inst_id','_anker_id','_open','_lit_data','_lit_data_id','_check_list','_check_plugin'));
if (Request::quoted('send')) {
    $_SESSION['_anker_id'] = null;
    $_SESSION['_open'] = null;
    $_SESSION['_lit_data'] = null;
    $_SESSION['_lit_data_id'] = null;
    $_SESSION['_check_list'] = null;
}
if (Request::get('open_element')) {
    $_SESSION['_open'][Request::option('open_element')] = true;
    $_anker_id = Request::option('open_element');
}
if (Request::get('close_element')) {
    unset($_SESSION['_open'][Request::option('close_element')]);
    $_SESSION['_anker_id'] = Request::option('close_element');
}
if (Request::option('_catalog_id')) {
Example #10
0
 /**
  * sets the global module and plugin settings for studygroups
  *
  * @return void
  */
 function savemodules_action()
 {
     global $perm;
     $perm->check("root");
     PageLayout::setHelpKeyword('Admin.Studiengruppen');
     if (Request::quoted('institute') == 'invalid') {
         $errors[] = _("Bitte wählen Sie eine Einrichtung aus, der die Studiengruppen zugeordnet werden sollen!");
     }
     if (!Request::quoted('terms') || Request::quoted('terms') == 'invalid') {
         $errors[] = _("Bitte tragen Sie Nutzungsbedingungen ein!");
     }
     if ($errors) {
         $this->flash['messages'] = array('error' => array('title' => 'Die Studiengruppen konnten nicht aktiviert werden!', 'details' => $errors));
         $this->flash['institute'] = Request::get('institute');
         $this->flash['terms'] = Request::get('terms');
     }
     if (!$errors) {
         $cfg = Config::get();
         if ($cfg->STUDYGROUPS_ENABLE == false && count(studygroup_sem_types()) > 0) {
             $cfg->store("STUDYGROUPS_ENABLE", true);
             $this->flash['success'] = _("Die Studiengruppen wurden aktiviert.");
         }
         if (Request::get('institute')) {
             $cfg->store('STUDYGROUP_DEFAULT_INST', Request::quoted('institute'));
             $cfg->store('STUDYGROUP_TERMS', Request::quoted('terms'));
             $this->flash['success'] = _("Die Einstellungen wurden gespeichert!");
         } else {
             $this->flash['error'] = _("Fehler beim Speichern der Einstellung!");
         }
     }
     $this->redirect('course/studygroup/globalmodules');
 }
Example #11
0
        while ($rs->next_record()) {
            $found_items[] = htmlReady($the_tree->tree->getItemPath($rs->f("item_id")));
            $the_tree->openItem($rs->f("item_id"));
        }
    }
    if (Request::get('search_user') && strlen(Request::get('search_user')) > 1) {
        $view->params[0] = "%" . Request::quoted('search_user') . "%";
        $view->params[1] = "%" . Request::quoted('search_user') . "%";
        $rs = $view->get_query("view:TREE_SEARCH_USER");
        while ($rs->next_record()) {
            $found_items[] = htmlReady($the_tree->tree->getItemPath($rs->f("item_id")));
            $the_tree->openItem($rs->f("item_id"));
        }
    }
    if (Request::get('search_sem') && strlen(Request::get('search_sem')) > 1) {
        $view->params[0] = "%" . Request::quoted('search_sem') . "%";
        $rs = $view->get_query("view:TREE_SEARCH_SEM");
        while ($rs->next_record()) {
            $found_items[] = htmlReady($the_tree->tree->getItemPath($rs->f("item_id")));
            $the_tree->openItem($rs->f("item_id"));
        }
    }
    if (count($found_items)) {
        $message = MessageBox::info(_('Gefundene Einrichtungen:'), $found_items);
    } else {
        $message = MessageBox::info(_('Es konnte keine Einrichtung gefunden werden, die Ihrer Suchanfrage entspricht.'));
    }
    PageLayout::postMessage($message);
}
?>
<h1><?php 
Example #12
0
        }
    }

    //Frage den Ordnerkörper ab
    if (Request::quoted("getfolderbody")) {
        if ($folder_tree->isExecutable(Request::quoted("getfolderbody") , $user->id)) {
            display_folder_body(Request::quoted("getfolderbody"), $folder_system_data["open"], null, $folder_system_data["move"], null, null, null, null);
        }
    }

    //Dateien eines Ordners sollen sortiert werden nach einem Array
    if (Request::quoted("folder_sort")) {
        if (($rechte) && (Request::quoted("folder_sort") == "root")) {

        } else {
            if (($rechte) || ($folder_tree->isWriteable(Request::quoted("folder_sort") , $user->id))) {
                $file_order = explode(",", Request::get('file_order'));
                $sorttype = "";
                if ($file_order) {
                    $query = "SELECT 1 FROM dokumente WHERE dokument_id = ?";
                    $statement = DBManager::get()->prepare($query);
                    $statement->execute(array($file_order[0]));
                    $result = $statement->fetchColumn();
                    if ($result) {
                        $sorttype = 'file';
                    } else {
                        $query = "SELECT 1 FROM folder WHERE folder_id = ?";
                        $statement = DBManager::get()->prepare($query);
                        $statement->execute(array($file_order[0]));
                        $result = $statement->fetchColumn();
                        if ($result) {
Example #13
0
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// +---------------------------------------------------------------------------+


require '../lib/bootstrap.php';

page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", 'user' => "Seminar_User"));
$perm->check("autor");

$search_key = Request::quoted('search_key');
$cms_select = Request::quoted('cms_select');
$new_account_cms = Request::quoted('new_account_cms');
include ('lib/seminar_open.php'); // initialise Stud.IP-Session

require_once ('lib/messaging.inc.php');

PageLayout::setTitle(_("Lernmodulsuche"));

if (Request::option('do_open'))
    $_SESSION['print_open_search'][Request::option('do_open')] = true;
elseif (Request::option('do_close'))
    $_SESSION['print_open_search'][Request::option('do_close')] = false;

if (Config::get()->ELEARNING_INTERFACE_ENABLE)
{

    include_once ($RELATIVE_PATH_ELEARNING_INTERFACE ."/" . "ELearningUtils.class.php");
    function execCommandMarkSem(){
        $item_id = Request::option('item_id');
        $marked_sem_array =  Request::quotedArray('marked_sem');
        $marked_sem = array_values(array_unique($marked_sem_array));
        $sem_aktion = explode("_",Request::quoted('sem_aktion'));
        if (($sem_aktion[0] == 'mark' || $sem_aktion[1] == 'mark') && count($marked_sem)){
            $count_mark = 0;
            for ($i = 0; $i < count($marked_sem); ++$i){
                if (!isset($this->marked_sem[$marked_sem[$i]])){
                    ++$count_mark;
                    $this->marked_sem[$marked_sem[$i]] = true;
                }
            }
            if ($count_mark){
                $this->msg[$item_id] = "msg§" . sprintf(_("Es wurde(n) %s Veranstaltung(en) der Merkliste hinzugefügt."),$count_mark);
            }
        }
        if ($this->isItemAdmin($item_id)){
            if (($sem_aktion[0] == 'del' || $sem_aktion[1] == 'del') && count($marked_sem)){
                $not_deleted = array();
                foreach($marked_sem as $key => $seminar_id){
                    $seminar = new Seminar($seminar_id);
                    if(count($seminar->getStudyAreas()) == 1){
                        $not_deleted[] = $seminar->getName();
                        unset($marked_sem[$key]);
                    }
                }
                if ($this->msg[$item_id]){
                    $this->msg[$item_id] .= "<br>";
                } else {
                    $this->msg[$item_id] = "msg§";
                }
                if(count($marked_sem)){
                    $count_del = $this->tree->DeleteSemEntries($item_id, $marked_sem);
                    $this->msg[$item_id] .= sprintf(_("%s Veranstaltungszuordnung(en) wurde(n) aufgehoben."),$count_del);
                }
                if(count($not_deleted)){
                    $this->msg[$item_id] .= '<br>'
                                         . sprintf(_("Für folgende Veranstaltungen wurde die Zuordnung nicht aufgehoben, da es die einzige Zuordnung ist: %s")
, '<br>'.htmlready(join(', ', $not_deleted)));
                }
            }
            $this->anchor = $item_id;
            $this->open_items[$item_id] = true;
            return true;
        }
        return false;
    }
Example #15
0
 * @author      Peter Thienel <thienel@data-quest.de>, Suchi & Berg GmbH <info@data-quest.de>
 * @author      Jens Schmelzer <jens.schmelzer@fh-jena.de>
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
 * @category    Stud.IP
 * @package     calendar
 */

use Studip\Button, Studip\LinkButton;

page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User"));
include ('lib/seminar_open.php'); // initialise Stud.IP-Session

$atime = Request::int('atime');
$element_switch = Request::get('element_switch', 0); // Wert für Auswahl der Feldbezeichner
$element_depending = (!is_null(Request::get('element_depending')) && preg_match('!^[0-9a-z_-]{2,40}$!i', Request::get('element_depending'))) ? Request::get('element_depending') : '';
$form_name = (!is_null(Request::get('form_name')) && preg_match('!^[0-9a-z_-]{2,40}$!i', Request::get('form_name'))) ? Request::quoted('form_name') : '';
$submit = Request::int('submit');
$c = !is_null(Request::get('c')) ? Request::get('c') : 0;                   // Zaehler wenn mehrere gleiche Eingabefelder im Zielformular
$mcount = Request::get('mcount', 1);    // Anzahl der anzuzeigenden Monate
$ss = Request::int('ss', ''); // Startstunde
$sm = Request::int('sm', ''); // Startminute
$es = Request::int('es', ''); // Endstunde
$em = Request::int('em', ''); // Endminute
$q = ($ss !== '') ? "&ss=$ss&sm=$sm&es=$es&em=$em" : '';

// Array mit Standardzeiten vorhanden?
if (isset($GLOBALS['TIME_PRESETS']) && is_array($GLOBALS['TIME_PRESETS']) && count($GLOBALS['TIME_PRESETS']) > 0) {
    $zz = $GLOBALS['TIME_PRESETS'];
    $preset_error = '';
} else {
    include_once('lib/msg.inc.php');
 function execCommandOrderCat()
 {
     $item_id = Request::option('item_id');
     $direction = Request::quoted('direction');
     $cat_id = Request::option('cat_id');
     $items_to_order = array();
     if ($this->isItemAdmin($item_id)) {
         $range_object = RangeTreeObject::GetInstance($item_id);
         $categories =& $range_object->getCategories();
         while ($categories->nextRow()) {
             $items_to_order[] = $categories->getField("kategorie_id");
         }
         for ($i = 0; $i < count($items_to_order); ++$i) {
             if ($cat_id == $items_to_order[$i]) {
                 break;
             }
         }
         if ($direction == "up" && isset($items_to_order[$i - 1])) {
             $items_to_order[$i] = $items_to_order[$i - 1];
             $items_to_order[$i - 1] = $cat_id;
         } elseif (isset($items_to_order[$i + 1])) {
             $items_to_order[$i] = $items_to_order[$i + 1];
             $items_to_order[$i + 1] = $cat_id;
         }
         $view = DbView::getView('range_tree');
         for ($i = 0; $i < count($items_to_order); ++$i) {
             $view->params = array($i, $items_to_order[$i]);
             $rs = $view->get_query("view:CAT_UPD_PRIO");
         }
         $this->msg[$item_id] = "msg§" . _("Datenfelder wurden neu geordnet");
     }
     $this->anchor = $item_id;
     return false;
 }
Example #17
0
 /**
  * check db-integrity
  *
  * checks if there are broken links in the database
  * @access public
  * @return boolean successful
  */
 function checkIntegrity()
 {
     global $ELEARNING_INTERFACE_MODULES, $messages;
     $db = DBManager::get();
     foreach ($ELEARNING_INTERFACE_MODULES as $cms_type => $data) {
         $cmsystems[$cms_type] = array();
     }
     $config = Config::get();
     foreach ($config->getFields('global', null, 'ELEARNING_INTERFACE_') as $key) {
         $parts = explode("_", $key);
         $cmsystems[$parts[2]]["config"]++;
     }
     $rs = $db->query("SELECT external_user_system_type, COUNT(*) as c FROM auth_extern GROUP BY external_user_system_type");
     while ($row = $rs->fetch()) {
         $cmsystems[$row["external_user_system_type"]]["accounts"] = $row['c'];
     }
     $rs = $db->query("SELECT system_type, COUNT(*) FROM object_contentmodules GROUP BY system_type");
     while ($row = $rs->fetch()) {
         $cmsystems[$row["system_type"]]["modules"] = $row['c'];
     }
     if (Request::submitted('delete')) {
         $messages["info"] .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\">";
         $messages["info"] .= CSRFProtection::tokenTag();
         $messages["info"] .= "<table>";
         $messages["info"] .= "<tr><td>&nbsp;</td></tr>";
         $messages["info"] .= "<tr><td>" . sprintf(_("Durch das Löschen der Daten zum System mit dem Index \"%s\" werden %s Konfigurationseinträge und Verknüpfungen von Stud.IP-Veranstaltungen und -User-Accounts unwiederbringlich aus der Stud.IP-Datenbank entfernt. Wollen Sie diese Daten jetzt löschen?"), Request::quoted('delete_cms'), $cmsystems[Request::quoted('delete_cms')]["accounts"] + $cmsystems[Request::quoted('delete_cms')]["modules"] + $cmsystems[Request::quoted('delete_cms')]["config"]) . "</td></tr>";
         $messages["info"] .= "<tr><td align=\"center\"><input type=\"hidden\" name=\"delete_cms\" value=\"" . Request::quoted('delete_cms') . "\">";
         $messages["info"] .= '<div class="button-group">' . Button::create(_('Alle löschen'), 'confirm_delete') . Button::createCancel(_('Abbrechen'), 'abbruch') . '<div></td></tr>';
         $messages["info"] .= "<tr><td align=\"center\"></td></tr>";
         $messages["info"] .= "</table>";
         $messages["info"] .= "</form>";
     }
     if (Request::submitted('confirm_delete')) {
         unset($cmsystems[Request::quoted('delete_cms')]);
         //          deleteCMSData(Request::quoted('delete_cms'));
         $messages["info"] .= _("Daten wurden gelöscht.");
     }
     foreach ($cmsystems as $cms_type => $data) {
         if ($ELEARNING_INTERFACE_MODULES[$cms_type]) {
             $output .= ELearningUtils::getCMSHeader($ELEARNING_INTERFACE_MODULES[$cms_type]["name"]);
             $output .= "<table>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             if (ELearningUtils::getConfigValue("ACTIVE", $cms_type)) {
                 $output .= "<tr><td>" . Icon::create('checkbox-checked', 'clickable')->asImg(['class' => 'text-top']) . "</td><td><b>" . sprintf(_("Die Schnittstelle zum System %s ist aktiv."), $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</b></td></tr>";
                 $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             } elseif ($data["config"] < 1) {
                 $output .= "<tr><td>" . Icon::create('checkbox-unchecked', 'clickable')->asImg(['class' => 'text-top']) . "</td><td><i>" . sprintf(_("Die Schnittstelle für das System %s wurde noch nicht eingerichtet."), $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</i></td></tr>";
             } elseif ($data["config"] < 1) {
                 $output .= "<tr><td>" . Icon::create('checkbox-unchecked', 'clickable')->asImg(['class' => 'text-top']) . "</td><td><i>" . sprintf(_("Die Schnittstelle wurde noch nicht aktiviert."), $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</i></td></tr>";
             }
             if ($data["accounts"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Stud.IP-User-Accounts sind mit Accounts im System %s verknüpft."), $data["accounts"], $ELEARNING_INTERFACE_MODULES[$cms_type]["name"]) . "</td></tr>";
             }
             if ($data["modules"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Objekte sind Stud.IP-Veranstaltungen oder -Einrichtungen zugeordnet."), $data["modules"]) . "</td></tr>";
             }
             if ($data["config"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Einträge in der config-Tabelle der Stud.IP-Datenbank."), $data["config"]) . "</td></tr>";
             }
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "</table>";
             $output .= ELearningUtils::getCMSFooter($ELEARNING_INTERFACE_MODULES[$cms_type]["logo_file"] ? "<img src=\"" . $ELEARNING_INTERFACE_MODULES[$cms_type]["logo_file"] . "\" border=\"0\">" : $cms_type);
         } else {
             $output .= ELearningUtils::getCMSHeader("<font color=FF0000> Unbekanntes System: " . $cms_type . "</font>");
             $output .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\">";
             $output .= CSRFProtection::tokenTag();
             $output .= "<table>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "<tr><td>" . Icon::create('decline', 'attention')->asImg(['class' => 'text-top']) . "</td><td><i>" . sprintf(_("Für das System mit dem Index \"%s\" existieren keine Voreinstellungen in den Konfigurationsdateien mehr."), $cms_type) . "</i></td></tr>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "<tr><td colspan=\"2\"><b>" . _("In der Stud.IP-Datenbank sind noch folgende Informationen zu diesem System gespeichert:") . "</b></td></tr>";
             if ($data["accounts"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Stud.IP-User-Accounts sind mit externen Accounts mit dem Index \"%s\" verknüpft."), $data["accounts"], $cms_type) . "</td></tr>";
             }
             if ($data["modules"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Objekte sind Stud.IP-Veranstaltungen oder -Einrichtungen zugeordnet."), $data["modules"]) . "</td></tr>";
             }
             if ($data["config"]) {
                 $output .= "<tr><td colspan=\"2\">" . sprintf(_("%s Einträge in der config-Tabelle der Stud.IP-Datenbank."), $data["config"]) . "</td></tr>";
             }
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "<tr><td align=\"center\" colspan=\"2\"><input type=\"hidden\" name=\"delete_cms\" value=\"" . $cms_type . "\">" . Button::create(_('Löschen'), 'delete') . "</td></tr>";
             $output .= "<tr><td colspan=\"2\">&nbsp;</td></tr>";
             $output .= "</table>";
             $output .= "</form>";
             $output .= ELearningUtils::getCMSFooter('');
         }
         $output .= "<br>";
     }
     return $output;
 }
Example #18
0
 /**
  * Old version of CSV import (copy and paste from teilnehmer.php
  * @return type
  * @throws AccessDeniedException
  */
 public function set_autor_csv_action()
 {
     // Security Check
     if (!$this->is_tutor) {
         throw new AccessDeniedException('Sie haben leider keine ausreichende Berechtigung, um auf diesen Bereich von Stud.IP zuzugreifen.');
     }
     CSRFProtection::verifyUnsafeRequest();
     // prepare CSV-Lines
     $messaging = new messaging();
     $csv_request = preg_split('/(\\n\\r|\\r\\n|\\n|\\r)/', trim(Request::get('csv_import')));
     $csv_mult_founds = array();
     $csv_count_insert = 0;
     $csv_count_multiple = 0;
     $datafield_id = null;
     if (Request::get('csv_import_format') && !in_array(Request::get('csv_import_format'), words('realname username'))) {
         foreach (DataField::getDataFields('user', 1 | 2 | 4 | 8, true) as $df) {
             if ($df->accessAllowed() && in_array($df->getId(), $GLOBALS['TEILNEHMER_IMPORT_DATAFIELDS']) && $df->getId() == Request::quoted('csv_import_format')) {
                 $datafield_id = $df->getId();
                 break;
             }
         }
     }
     if (Request::get('csv_import')) {
         // remove duplicate users from csv-import
         $csv_lines = array_unique($csv_request);
         $csv_count_contingent_full = 0;
         foreach ($csv_lines as $csv_line) {
             $csv_name = preg_split('/[,\\t]/', substr($csv_line, 0, 100), -1, PREG_SPLIT_NO_EMPTY);
             $csv_nachname = trim($csv_name[0]);
             $csv_vorname = trim($csv_name[1]);
             if ($csv_nachname) {
                 if (Request::quoted('csv_import_format') == 'realname') {
                     $csv_users = $this->members->getMemberByIdentification($csv_nachname, $csv_vorname);
                 } elseif (Request::quoted('csv_import_format') == 'username') {
                     $csv_users = $this->members->getMemberByUsername($csv_nachname);
                 } else {
                     $csv_users = $this->members->getMemberByDatafield($csv_nachname, $datafield_id);
                 }
             }
             // if found more then one result to given name
             if (count($csv_users) > 1) {
                 // if user have two accounts
                 $csv_count_present = 0;
                 foreach ($csv_users as $row) {
                     if ($row['is_present']) {
                         $csv_count_present++;
                     } else {
                         $csv_mult_founds[$csv_line][] = $row;
                     }
                 }
                 if (is_array($csv_mult_founds[$csv_line])) {
                     $csv_count_multiple++;
                 }
             } elseif (count($csv_users) > 0) {
                 $row = reset($csv_users);
                 if (!$row['is_present']) {
                     $consider_contingent = Request::option('consider_contingent_csv');
                     if (insert_seminar_user($this->course_id, $row['user_id'], 'autor', isset($consider_contingent), $consider_contingent)) {
                         $csv_count_insert++;
                         setTempLanguage($this->user_id);
                         $message = sprintf(_('Sie wurden in die Veranstaltung **%s** eingetragen.'), $this->course_title);
                         restoreLanguage();
                         $messaging->insert_message($message, $row['username'], '____%system%____', FALSE, FALSE, '1', FALSE, sprintf('%s %s', _('Systemnachricht:'), _('Eintragung in Veranstaltung')), TRUE);
                     } elseif (isset($consider_contingent)) {
                         $csv_count_contingent_full++;
                     }
                 } else {
                     $csv_count_present++;
                 }
             } else {
                 // not found
                 $csv_not_found[] = stripslashes($csv_nachname) . ($csv_vorname ? ', ' . stripslashes($csv_vorname) : '');
             }
         }
     }
     $selected_users = Request::getArray('selected_users');
     if (!empty($selected_users) && count($selected_users) > 0) {
         foreach ($selected_users as $selected_user) {
             if ($selected_user) {
                 if (insert_seminar_user($this->course_id, get_userid($selected_user), 'autor', isset($consider_contingent), $consider_contingent)) {
                     $csv_count_insert++;
                     setTempLanguage($this->user_id);
                     if ($GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$_SESSION['SessSemName']['art_num']]['class']]['workgroup_mode']) {
                         $message = sprintf(_('Sie wurden manuell in die Veranstaltung **%s** eingetragen.'), $this->course_title);
                     } else {
                         $message = sprintf(_('Sie wurden manuell in die Veranstaltung **%s** eingetragen.'), $this->course_title);
                     }
                     restoreLanguage();
                     $messaging->insert_message($message, $selected_user, '____%system%____', FALSE, FALSE, '1', FALSE, sprintf('%s %s', _('Systemnachricht:'), _('Eintragung in Veranstaltung')), TRUE);
                 } elseif (isset($consider_contingent)) {
                     $csv_count_contingent_full++;
                 }
             }
         }
     }
     // no results
     if (!sizeof($csv_lines) && !sizeof($selected_users)) {
         PageLayout::postMessage(MessageBox::error(_("Niemanden gefunden!")));
     }
     if ($csv_count_insert) {
         PageLayout::postMessage(MessageBox::success(sprintf(_('%s Personen in die Veranstaltung
             eingetragen!'), $csv_count_insert)));
     }
     if ($csv_count_present) {
         PageLayout::postMessage(MessageBox::info(sprintf(_('%s Personen waren bereits in der Veranstaltung
             eingetragen!'), $csv_count_present)));
     }
     // redirect to manual assignment
     if ($csv_mult_founds) {
         PageLayout::postMessage(MessageBox::info(sprintf(_('%s Personen konnten <b>nicht eindeutig</b>
             zugeordnet werden! Nehmen Sie die Zuordnung bitte manuell vor.'), $csv_count_multiple)));
         $this->flash['csv_mult_founds'] = $csv_mult_founds;
         $this->redirect('course/members/csv_manual_assignment');
         return;
     }
     if (count($csv_not_found) > 0) {
         PageLayout::postMessage(MessageBox::error(sprintf(_('%s konnten <b>nicht</b> zugeordnet werden!'), htmlReady(join(',', $csv_not_found)))));
     }
     if ($csv_count_contingent_full) {
         PageLayout::postMessage(MessageBox::error(sprintf(_('%s Personen konnten <b>nicht</b> zugeordnet werden,
             da das ausgewählte Kontingent keine freien Plätze hat.'), $csv_count_contingent_full)));
     }
     $this->redirect('course/members/index');
 }
 /**
  * @return bool|string
  */
 function auth_doregister()
 {
     global $_language_path;
     $this->error_msg = "";
     // check for direct link to register2.php
     if (!$_SESSION['_language'] || $_SESSION['_language'] == "") {
         $_SESSION['_language'] = get_accepted_languages();
     }
     $_language_path = init_i18n($_SESSION['_language']);
     $this->auth["uname"] = Request::username('username');
     // This provides access for "crcregister.ihtml"
     $validator = new email_validation_class();
     // Klasse zum Ueberpruefen der Eingaben
     $validator->timeout = 10;
     // Wie lange warten wir auf eine Antwort des Mailservers?
     if (!Seminar_Session::check_ticket(Request::option('login_ticket'))) {
         return false;
     }
     $username = trim(Request::get('username'));
     $Vorname = trim(Request::get('Vorname'));
     $Nachname = trim(Request::get('Nachname'));
     // accept only registered domains if set
     $cfg = Config::GetInstance();
     $email_restriction = $cfg->getValue('EMAIL_DOMAIN_RESTRICTION');
     if ($email_restriction) {
         $Email = trim(Request::get('Email')) . '@' . trim(Request::get('emaildomain'));
     } else {
         $Email = trim(Request::get('Email'));
     }
     if (!$validator->ValidateUsername($username)) {
         $this->error_msg = $this->error_msg . _("Der gewählte Benutzername ist zu kurz!") . "<br>";
         return false;
     }
     // username syntaktisch falsch oder zu kurz
     // auf doppelte Vergabe wird weiter unten getestet.
     if (!$validator->ValidatePassword(Request::quoted('password'))) {
         $this->error_msg = $this->error_msg . _("Das Passwort ist zu kurz!") . "<br>";
         return false;
     }
     if (!$validator->ValidateName($Vorname)) {
         $this->error_msg = $this->error_msg . _("Der Vorname fehlt oder ist unsinnig!") . "<br>";
         return false;
     }
     // Vorname nicht korrekt oder fehlend
     if (!$validator->ValidateName($Nachname)) {
         $this->error_msg = $this->error_msg . _("Der Nachname fehlt oder ist unsinnig!") . "<br>";
         return false;
         // Nachname nicht korrekt oder fehlend
     }
     if (!$validator->ValidateEmailAddress($Email)) {
         $this->error_msg = $this->error_msg . _("Die E-Mail-Adresse fehlt oder ist falsch geschrieben!") . "<br>";
         return false;
     }
     // E-Mail syntaktisch nicht korrekt oder fehlend
     $REMOTE_ADDR = $_SERVER["REMOTE_ADDR"];
     $Zeit = date("H:i:s, d.m.Y", time());
     if (!$validator->ValidateEmailHost($Email)) {
         // Mailserver nicht erreichbar, ablehnen
         $this->error_msg = $this->error_msg . _("Der Mailserver ist nicht erreichbar, bitte überprüfen Sie, ob Sie E-Mails mit der angegebenen Adresse verschicken und empfangen können!") . "<br>";
         return false;
     } else {
         // Server ereichbar
         if (!$validator->ValidateEmailBox($Email)) {
             // aber user unbekannt. Mail an abuse!
             StudipMail::sendAbuseMessage("Register", "Emailbox unbekannt\n\nUser: {$username}\nEmail: {$Email}\n\nIP: {$REMOTE_ADDR}\nZeit: {$Zeit}\n");
             $this->error_msg = $this->error_msg . _("Die angegebene E-Mail-Adresse ist nicht erreichbar, bitte überprüfen Sie Ihre Angaben!") . "<br>";
             return false;
         } else {
             // Alles paletti, jetzt kommen die Checks gegen die Datenbank...
         }
     }
     $check_uname = StudipAuthAbstract::CheckUsername($username);
     if ($check_uname['found']) {
         //   error_log("username schon vorhanden", 0);
         $this->error_msg = $this->error_msg . _("Der gewählte Benutzername ist bereits vorhanden!") . "<br>";
         return false;
         // username schon vorhanden
     }
     if (count(User::findBySQL("Email LIKE " . DbManager::get()->quote($Email)))) {
         $this->error_msg = $this->error_msg . _("Die angegebene E-Mail-Adresse wird bereits von einem anderen Benutzer verwendet. Sie müssen eine andere E-Mail-Adresse angeben!") . "<br>";
         return false;
         // Email schon vorhanden
     }
     // alle Checks ok, Benutzer registrieren...
     $hasher = UserManagement::getPwdHasher();
     $new_user = new User();
     $new_user->username = $username;
     $new_user->perms = 'user';
     $new_user->password = $hasher->HashPassword(Request::get('password'));
     $new_user->vorname = $Vorname;
     $new_user->nachname = $Nachname;
     $new_user->email = $Email;
     $new_user->geschlecht = Request::int('geschlecht');
     $new_user->title_front = trim(Request::get('title_front', Request::get('title_front_chooser')));
     $new_user->title_rear = trim(Request::get('title_rear', Request::get('title_rear_chooser')));
     $new_user->auth_plugin = 'standard';
     $new_user->store();
     if ($new_user->user_id) {
         self::sendValidationMail($new_user);
         $this->auth["perm"] = $new_user->perms;
         return $new_user->user_id;
     }
 }
Example #20
0
                            $choose_module_select .= '<option value="" style="font-weight: bold;">' . htmlReady($GLOBALS['EXTERN_MODULE_TYPES'][$module_type]['name']) . '</option>';
                        }
                        $choose_module_select .= '<option value="' . $config_id_copy . '">&nbsp;&nbsp;' . htmlReady($config_data_copy['name']) . '</option>';
                        $print_module_name = FALSE;
                    }
                }
            }

            echo '<form method="post" action="' . URLHelper::getLink('?com=copyconfig') . '">';
            echo CSRFProtection::tokenTag();
            echo "<blockquote><font size=\"2\">";
            printf(_("Konfiguration %s aus Einrichtung kopieren."), $choose_module_select . '</select>');
            echo Button::create(_("Kopieren"));
            echo LinkButton::create("<< " . _("Zurück"), URLHelper::getURL('?list=TRUE&view=extern_inst'));
            echo "</font></blockquote>\n";
            echo "<input type=\"hidden\" name=\"copyinstid\" value=\"" . htmlReady(Request::quoted('copychooseinst')) . "\">\n";
            echo "</form>\n";

        }
    }
}
else {
    echo "<blockquote><font size=\"2\">";
    echo _("Sie haben bereits für alle Module die maximale Anzahl von Konfigurationen angelegt. Um eine neue Konfiguration anzulegen, müssen Sie erst eine bestehende im gewünschten Modul löschen.");
    echo "</font></blockquote>\n";
}

echo "</td></tr>\n";

if (!$have_config) {
    echo "<tr><td class=\"blank\">\n<blockquote>\n<font size=\"2\">";
 function execCommandOrderItem()
 {
     $direction = Request::quoted('direction');
     $item_id = Request::option('item_id');
     $items_to_order = $this->tree->getKids($this->tree->tree_data[$item_id]['parent_id']);
     if (!$items_to_order) {
         return false;
     }
     for ($i = 0; $i < count($items_to_order); ++$i) {
         if ($item_id == $items_to_order[$i]) {
             break;
         }
     }
     if ($direction == "up" && isset($items_to_order[$i - 1])) {
         $items_to_order[$i] = $items_to_order[$i - 1];
         $items_to_order[$i - 1] = $item_id;
     } elseif (isset($items_to_order[$i + 1])) {
         $items_to_order[$i] = $items_to_order[$i + 1];
         $items_to_order[$i + 1] = $item_id;
     }
     for ($i = 0; $i < count($items_to_order); ++$i) {
         if ($this->tree->isElement($item_id)) {
             $this->tree->updateElement(array('priority' => $i, 'list_element_id' => $items_to_order[$i]));
         } else {
             $this->tree->updateList(array('priority' => $i, 'list_id' => $items_to_order[$i]));
         }
     }
     $this->mode = "";
     $this->msg[$item_id] = "msg§" . ($direction == "up" ? _("Element wurde um eine Position nach oben verschoben.") : _("Element wurde um eine Position nach unten verschoben."));
     return true;
 }
Example #22
0
            }
            footer();
        }
    }
    // checking semi_logged_in is important to avoid abuse
} else {
    if (Request::get('email1') && Request::get('email2') && $_SESSION['semi_logged_in'] == Request::option('uid')) {
        if (Request::get('email1') == Request::get('email2')) {
            // change mail
            require_once 'lib/edit_about.inc.php';
            $tmp_user = User::find(Request::option('uid'));
            $send = edit_email($tmp_user, Request::quoted('email1'), True);
            if ($send[0]) {
                $_SESSION['semi_logged_in'] = False;
                head(PageLayout::getTitle());
                printf(_('An %s wurde ein Aktivierungslink geschickt.'), Request::quoted('email1'));
                footer();
            } else {
                head(_('Fehler'), True);
                echo parse_msg($send[1]);
                footer();
                head(PageLayout::getTitle());
                reenter_mail();
                footer();
            }
        } else {
            head(PageLayout::getTitle());
            printf('<b>%s</b>', _('Die eingegebenen E-Mail-Adressen stimmen nicht überein. Bitte überprüfen Sie Ihre Eingabe.'));
            reenter_mail();
            footer();
        }
Example #23
0
    }
}
if (Request::option('cmd') == "MarkList") {
    $sem_mark_list = Request::quotedArray('sem_mark_list');
    if ($sem_mark_list) {
        if (Request::quoted('mark_list_aktion') == "del") {
            $count_del = 0;
            for ($i = 0; $i < count($sem_mark_list); ++$i) {
                if (isset($_SESSION['_marked_sem'][$sem_mark_list[$i]])) {
                    ++$count_del;
                    unset($_SESSION['_marked_sem'][$sem_mark_list[$i]]);
                }
            }
            $_msg .= "msg§" . sprintf(_("%s Veranstaltung(en) wurde(n) aus Ihrer Merkliste entfernt."), $count_del);
        } else {
            $tmp = explode("_", Request::quoted('mark_list_aktion'));
            $item_ids[0] = $tmp[1];
            if ($item_ids[0] == "all") {
                $item_ids = array();
                foreach ($_possible_open_items as $key => $value) {
                    if ($key != 'root') {
                        $item_ids[] = $key;
                    }
                }
            }
            for ($i = 0; $i < count($item_ids); ++$i) {
                $count_ins = 0;
                for ($j = 0; $j < count($sem_mark_list); ++$j) {
                    if ($sem_mark_list[$j]) {
                        $count_ins += StudipSemTree::InsertSemEntry($item_ids[$i], $sem_mark_list[$j]);
                    }
 function doSearch()
 {
     if (Request::submitted($this->form_name . "_do_search") || Request::submitted($this->form_name . "_send")) {
         if (strlen($_REQUEST[$this->form_name . "_search_field"]) > 2) {
             $this->view->params[0] = "%" . Request::quoted($this->form_name . "_search_field") . "%";
             $this->view->params[1] = $this->sem_tree_ids;
             $rs = $this->view->get_query("view:SEM_TREE_SEARCH_ITEM");
             while ($rs->next_record()) {
                 $this->sem_tree_ranges[$rs->f("parent_id")][] = $rs->f("sem_tree_id");
                 $this->sem_tree_ids[] = $rs->f("sem_tree_id");
                 $this->search_result[$rs->f("sem_tree_id")] = true;
             }
             $this->num_search_result = $rs->num_rows();
         }
         $this->search_done = true;
     }
     return;
 }
Example #25
0
     // Page was edited and submitted
     //
     submitWikiPage($keyword, $version, Studip\Markup::purifyHtml(Request::get('body')), $user->id, $SessSemName[1]);
     $version = "";
     // $version="" means: get latest
 } else {
     if ($cmd == "abortedit") {
         // Editieren abgebrochen
         //
         // Editing page was aborted
         //
         releasePageLocks($keyword, $user->id);
         // kill lock (set when starting to edit)
         if (Request::quoted('lastpage')) {
             // if editing new page was aborted, display last page again
             $keyword = Request::quoted('lastpage');
         }
     } else {
         if ($cmd == "delete") {
             //
             // Delete request sent -> confirmdialog and current page
             //
             $special = "delete";
         } else {
             if ($cmd == "really_delete") {
                 //
                 // Delete was confirmed -> really delete
                 //
                 $keyword = deleteWikiPage($keyword, $version, $SessSemName[1]);
                 $version = "";
                 // show latest version
 /**
  * Return current user - deprecated, do not use.
  *
  * @deprecated
  */
 function getRequestedUser()
 {
     $username = Request::quoted('username', $GLOBALS['auth']->auth['uname']);
     $user_id = get_userid($username);
     if ($user_id == '') {
         return NULL;
     }
     return new StudIPUser($user_id);
 }
Example #27
0
/*****************************************************************************
evaluate the commands from schedule navigator (sem mode)
/*****************************************************************************/
if ($view == "view_sem_schedule" || $view == "view_group_schedule" || $view == "view_group_schedule_daily" || $view == 'openobject_group_schedule') {

    if (Request::quoted('next_sem')){
        $sem_array = SemesterData::GetSemesterArray();
        foreach ($sem_array as $id => $one_sem){
            if ($one_sem['semester_id'] == $_SESSION['resources_data']['sem_schedule_semester_id'] && isset($sem_array[$id+1])){
                $_SESSION['resources_data']['sem_schedule_semester_id'] = $sem_array[$id+1]['semester_id'];
                break;
            }
        }
    }
    if (Request::quoted('previous_sem')){
        $sem_array = SemesterData::GetSemesterArray();
        foreach ($sem_array as $id => $one_sem){
            if ($one_sem['semester_id'] == $_SESSION['resources_data']['sem_schedule_semester_id'] && ($id-1) && isset($sem_array[$id-1])){
                $_SESSION['resources_data']['sem_schedule_semester_id'] = $sem_array[$id-1]['semester_id'];
                break;
            }
        }
    }
    if($view == "view_group_schedule_daily" || $view == 'openobject_group_schedule'){
        if(Request::submitted('jump')) {
            $splitDate = explode('.',  $_REQUEST['schedule_begin_date']);

            $_SESSION['resources_data']["schedule_start_time"] = mktime (0, 0, 0, $splitDate[1], $splitDate[0], $splitDate[2]);
            //$_SESSION['resources_data']["schedule_start_time"] = mktime (0, 0, 0, Request::int('schedule_begin_month'), Request::int('schedule_begin_day'), Request::int('schedule_begin_year'));
Example #28
0
    if ($type["module"] == $module_name) {
        $class_name = "ExternModule" . $module_name;
        require_once($RELATIVE_PATH_EXTERN . "/modules/$class_name.class.php");
        $module_obj = ExternModule::GetInstance($range_id, $module_name, $config_id, $default, $global_id);
    }
}
// drop URL parameters from page_url 
$page_url = preg_replace('/\?.*/', '', Request::get('page_url'));
 
$sri_url = $module_obj->config->getValue('Main', 'sriurl'); 

if (isset($sri_url)) { 
    // drop URL parameters from sri_url 
    $sri_url = preg_replace('/\?.*/', '', $sri_url); 
} 

if ($page_url != $sri_url || !sri_is_enabled($module_obj->config->range_id)) { 

    echo $EXTERN_ERROR_MESSAGE;
    exit;
}

$args = $module_obj->getArgs();
foreach ($args as $arg) {
    $arguments[$arg] = Request::quoted($arg);
}

echo $sri_matches[1];
$module_obj->printout($arguments);
echo $sri_matches[3];
Example #29
0
    $_SESSION['_user_activities']['open'] = array();
    $_SESSION['_user_activities']['details'] = 'files';
}
if (Request::get('details')) {
    $_SESSION['_user_activities']['details'] = Request::option('details');
}
if (Request::get('open')) {
    $_SESSION['_user_activities']['open'][Request::get('open')] = time();
}
if (Request::get('close')) {
    unset($_SESSION['_user_activities']['open'][Request::get('close')]);
}
$user_id = get_userid($_SESSION['_user_activities']['username']);
arsort($_SESSION['_user_activities']['open'], SORT_NUMERIC);
if (Request::get('download_as_zip')) {
    $download_ids = Request::quoted('download_as_zip') == 'all' ? get_user_documents($user_id) : get_user_documents($user_id, Request::quoted('download_as_zip'));
    if (is_array($download_ids) && count($download_ids)) {
        $zip_file_id = createSelectedZip($download_ids, false);
        $zip_name = prepareFilename($_SESSION['_user_activities']['username'] . '-' . _("Dokumente") . '.zip');
        header('Location: ' . getDownloadLink($zip_file_id, $zip_name, 4));
        page_close();
        die;
    }
}
reset($_SESSION['_user_activities']['open']);
$ank = key($_SESSION['_user_activities']['open']);
// Define structure of displayed information
$queries[] = array('desc' => _('Eingetragen in Veranstaltungen (dozent / tutor / autor / user)'), 'query' => "SELECT CONCAT_WS(' / ', SUM(status = 'dozent'), SUM(status = 'tutor'),\n                                          SUM(status = 'autor'), SUM(status = 'user'))\n                  FROM seminar_user\n                  WHERE user_id = ?\n                  GROUP BY user_id", 'details' => "details=seminar");
$queries[] = array('desc' => _('Eingetragen in geschlossenen Veranstaltungen (dozent / tutor / autor / user)'), 'query' => "SELECT CONCAT_WS(' / ', SUM(su.status = 'dozent'), SUM(su.status = 'tutor'),\n                                          SUM(su.status = 'autor'), SUM(su.status = 'user'))\n                  FROM seminar_user AS su\n                  INNER JOIN seminar_courseset sc USING (seminar_id)\n                  INNER JOIN courseset_rule cr ON cr.set_id=sc.set_id AND cr.type='ParticipantRestrictedAdmission'\n                  WHERE user_id = ?\n                  GROUP BY user_id", 'details' => "details=seminar_closed");
$queries[] = array('desc' => _("Eingetragen in Wartelisten (wartend / vorläufig akzeptiert)"), 'query' => "SELECT CONCAT_WS(' / ', SUM(status = 'awaiting'), SUM(status = 'accepted'))\n                  FROM admission_seminar_user\n                  WHERE user_id = ?\n                  GROUP BY user_id", 'details' => "details=seminar_wait");
$queries[] = array('desc' => _("Eingetragen in Anmeldelisten"), 'query' => "SELECT COUNT(*)\n                  FROM priorities\n                  WHERE user_id = ?\n                  GROUP BY user_id", 'details' => "details=seminar_claiming");
Example #30
0
 /**
  * Displays page for literature search
  */
 public function search_action()
 {
     $GLOBALS['perm']->check("autor");
     PageLayout::setHelpKeyword("Basis.Literatursuche");
     PageLayout::setTitle(_("Literatursuche"));
     if (Request::option('return_range') == "self") {
         $this->return_range = $GLOBALS['user']->id;
     } else {
         if (Request::option('return_range')) {
             $this->return_range = Request::option('return_range');
         } else {
             $this->return_range = $_SESSION['_lit_range'];
         }
     }
     if (!$this->return_range) {
         $this->return_range = $GLOBALS['user']->id;
     }
     $_SESSION['_lit_range'] = $this->return_range;
     if ($this->return_range != $GLOBALS['user']->id) {
         Navigation::activateItem('/course/literature/search');
         $this->return_range = $_SESSION['SessSemName'][1] ? $_SESSION['SessSemName'][1] : $this->return_range;
     } else {
         Navigation::activateItem('/tools/literature/search');
         closeObject();
     }
     $_the_search = new StudipLitSearch();
     $_the_clipboard = StudipLitClipBoard::GetInstance();
     $_the_clip_form = $_the_clipboard->getFormObject();
     if (Request::quoted('change_start_result')) {
         $_the_search->start_result = Request::quoted('change_start_result');
     }
     if ($_the_clip_form->isClicked("clip_ok")) {
         $_the_clipboard->doClipCmd();
     }
     if ($_the_search->outer_form->isClicked("search") || $_the_search->outer_form->isSended() && !$_the_search->outer_form->isClicked("reset") && !$_the_search->outer_form->isClicked("change") && !$_the_search->outer_form->isClicked("search_add") && !$_the_search->outer_form->isClicked("search_sub") && !$_the_search->outer_form->isChanged("search_plugin")) {
         $hits = $_the_search->doSearch();
         if (!$_the_search->search_plugin->getNumError()) {
             if ($_the_search->getNumHits() == 0) {
                 $_msg = sprintf(_("Ihre Suche ergab %s Treffer."), $_the_search->getNumHits());
             } else {
                 $_msg = sprintf(_("Ihre Suche ergab %s Treffer."), $_the_search->getNumHits());
             }
             PageLayout::postMessage(MessageBox::info($_msg));
         }
         $_the_search->start_result = 1;
     }
     if (Request::option('cmd') == "add_to_clipboard") {
         $catalog_id = Request::option('catalog_id');
         if ($catalog_id[0] == "_") {
             $parts = explode("__", $catalog_id);
             if ($fields = $_SESSION[$parts[0]][$parts[1]]) {
                 $cat_element = new StudipLitCatElement();
                 $cat_element->setValues($fields);
                 $cat_element->setValue("catalog_id", "new_entry");
                 $cat_element->setValue("user_id", "studip");
                 if ($existing_element = $cat_element->checkElement()) {
                     $cat_element->setValue('catalog_id', $existing_element);
                 }
                 $cat_element->insertData();
                 $catalog_id = $cat_element->getValue("catalog_id");
                 $_SESSION[$parts[0]][$parts[1]]['catalog_id'] = $catalog_id;
                 unset($cat_element);
             }
         }
         $_the_clipboard->insertElement($catalog_id);
     }
     $_msg .= $_the_search->search_plugin->getError("msg");
     $this->msg = $_msg;
     $this->search = $_the_search;
     $this->clipboard = $_the_clipboard;
     $this->clip_form = $_the_clip_form;
 }