Ejemplo n.º 1
0
/**
 * Get status of plugin, loaded or not
 *
 * @param integer $uid        
 * @param string $plugin_category        
 * @param string $plugin_name        
 * @return boolean
 */
function core_plugin_get_status($uid, $plugin_category, $plugin_name)
{
    $ret = FALSE;
    // check config.php and fn.php
    $plugin_category = core_sanitize_path($plugin_category);
    $plugin_name = core_sanitize_path($plugin_name);
    $fn_cnf = _APPS_PATH_PLUG_ . '/' . $plugin_category . '/' . $plugin_name . '/config.php';
    $fn_lib = _APPS_PATH_PLUG_ . '/' . $plugin_category . '/' . $plugin_name . '/fn.php';
    if (file_exists($fn_cnf) && $fn_lib) {
        // check plugin_status registry
        $status = registry_search($uid, $plugin_category, $plugin_name, 'enabled');
        // $status = 1 for disabled
        // $status = 2 for enabled
        if ($status == 2) {
            $ret = TRUE;
        }
    }
    return $ret;
}
Ejemplo n.º 2
0
<?php

defined('_SECURE_') or die('Forbidden');
// get gammu config from registry
$data = registry_search(0, 'gateway', 'gammu');
$plugin_config['gammu']['name'] = 'gammu';
$plugin_config['gammu']['path'] = trim(core_sanitize_path($data['gateway']['gammu']['path']));
if (!$plugin_config['gammu']['path']) {
    $plugin_config['gammu']['path'] = '/var/spool/gammu';
}
$plugin_config['gammu']['dlr'] = TRUE;
// smsc configuration
$plugin_config['gammu']['_smsc_config_'] = array('path' => _('Spool folder'));
// insert to left menu array
//if (isadmin()) {
//	$menutab_gateway = $core_config['menutab']['gateway'];
//	$menu_config[$menutab_gateway][] = array("index.php?app=main&inc=gateway_gammu&op=manage", _('Manage gammu'));
//}
Ejemplo n.º 3
0
<?php

defined('_SECURE_') or die('Forbidden');
// get gammu config from registry
$data = registry_search(0, 'gateway', 'smstools');
$plugin_config['smstools']['name'] = 'smstools';
$plugin_config['smstools']['default_queue'] = trim(core_sanitize_path($data['gateway']['smstools']['default_queue']));
if (!$plugin_config['smstools']['default_queue']) {
    $plugin_config['smstools']['default_queue'] = "/var/spool/sms";
}
// smsc configuration
$plugin_config['smstools']['_smsc_config_'] = array('sms_receiver' => _('Receiver number'), 'queue' => _('Queue directory'));
// insert to left menu array
//if (isadmin()) {
//	$menutab_gateway = $core_config['menutab']['gateway'];
//	$menu_config[$menutab_gateway][] = array("index.php?app=main&inc=gateway_smstools&op=manage", _('Manage smstools'));
//}
Ejemplo n.º 4
0
 * playSMS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * 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 playSMS. If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
if (!auth_isadmin()) {
    auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/gammu/config.php";
switch (_OP_) {
    case "manage":
        if ($err = TRUE) {
            $content = _dialog();
        }
        $content .= "\n\t\t\t<h2>" . _('Manage gammu') . "</h2>\n\t\t\t<form action=index.php?app=main&inc=gateway_gammu&op=manage_save method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<table class=playsms-table>\n\t\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=label-sizer>" . _('Gateway name') . "</td><td>gammu</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Spool folder') . "</td><td><input type=text name=up_path value=\"" . $plugin_config['gammu']['path'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t</form>";
        $content .= _back('index.php?app=main&inc=core_gateway&op=gateway_list');
        _p($content);
        break;
    case "manage_save":
        $up_path = core_sanitize_path($_POST['up_path']);
        $items = array('path' => $up_path);
        registry_update(0, 'gateway', 'gammu', $items);
        $_SESSION['dialog']['info'][] = _('Changes have been made');
        header("Location: " . _u('index.php?app=main&inc=gateway_gammu&op=manage'));
        exit;
        break;
}
Ejemplo n.º 5
0
 *
 * playSMS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * 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 playSMS. If not, see <http://www.gnu.org/licenses/>.
 */
defined('_SECURE_') or die('Forbidden');
if (!auth_isadmin()) {
    auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/smstools/config.php";
switch (_OP_) {
    case "manage":
        $content .= _dialog() . "\n\t\t\t<h2>" . _('Manage smstools') . "</h2>\n\t\t\t<form action=index.php?app=main&inc=gateway_smstools&op=manage_save method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<table class=playsms-table>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=label-sizer>" . _('Gateway name') . "</td><td>smstools</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . _('Default default_queue directory') . "</td><td><input type=text name=up_default_queue value=\"" . $plugin_config['smstools']['default_queue'] . "\"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t</form>\n\t\t\t<p>" . _back('index.php?app=main&inc=core_gateway&op=gateway_list');
        _p($content);
        break;
    case "manage_save":
        $up_default_queue = trim(core_sanitize_path($_POST['up_default_queue']));
        if (!$up_default_queue) {
            $up_default_queue = "/var/spool/sms";
        }
        $items = array('default_queue' => $up_default_queue);
        registry_update(0, 'gateway', 'smstools', $items);
        $_SESSION['dialog']['info'][] = _('Changes have been made');
        header("Location: " . _u('index.php?app=main&inc=gateway_smstools&op=manage'));
        exit;
        break;
}