Exemplo n.º 1
0
                                $accid =& $v['text'][$i]['accountids'][$j];
                                $acc =& $accounts[$type][$accid];
                                $accName[] = $acc['name'];
                                switch ($type) {
                                    case 0:
                                        Funclib::sendAlarmMail($acc['email'], $acc['name'], $data['unternehmenid'], $m);
                                        break;
                                    case 1:
                                        Funclib::sendStreamMessage($acc['apibase'], $acc['name'], $acc['authurl'], $acc['requesturl'], $acc['accessurl'], $acc['costumerkey'], $acc['costumersecret'], $acc['oauth_token'], $acc['oauth_token_secret'], $acc['maxlength'], $data['unternehmenid'], $m);
                                        break;
                                    case 2:
                                        Funclib::sendSMS($acc['url'], $acc['nummer'], $acc['name'], $acc['gatewayname'], $acc['maxlength'], $data['unternehmenid'], $m);
                                        break;
                                }
                            }
                            Funclib::messageLog($data['unternehmenid'], $m, implode(', ', $accName));
                        }
                        if ($v['dolock']) {
                            Funclib::lockCondition($data['unternehmenid'], $k);
                            Funclib::insertError($data['unternehmenid'], $signatur, 'now publish condition "' . $v['name'] . '" is locked. Please delete this message to unlock this condition.', 0, $k);
                        }
                    } else {
                        Funclib::insertError($data['unternehmenid'], $signatur, 'couldn\'t execute publish condition "' . $v['name'] . '". Reason: condition is locked', 1);
                    }
                }
            } else {
                Funclib::insertError($data['unternehmenid'], $signatur, 'couldn\'t execute publish condition "' . $v['name'] . '". Reason: not all required variables are set', 1);
            }
        }
    }
}
Exemplo n.º 2
0
switch ($this->_post('aktion')) {
    case 'delete_fehler':
        DB::query('SELECT
                        `conditionid`
                    FROM
                        `fehler_log`
                    WHERE
                        `logid` = ?
                    AND
                        `unternehmenid` = ?', 2);
        DB::setParam($this->_post('logid'), 'int');
        DB::setParam($_SESSION['unternehmenid'], 'int');
        DB::exec();
        if (DB::numRows() == 1) {
            DB::nextResult();
            Funclib::lockCondition($_SESSION['unternehmenid'], DB::result('conditionid'), true);
            DB::query('DELETE FROM
                           `fehler_log`
                       WHERE
                           `logid` = ?', 1);
            DB::setParam($this->_post('logid'), 'int');
            DB::exec();
        } else {
            $this->_jsonOutput(2, 'the chosen error message does not exist');
        }
        break;
    case 'delete_event':
        DB::query('SELECT
                        `logid`
                    FROM
                        `events_log`