Beispiel #1
0
function FlashChatBridge_delete()
{
    // L�sche alle Modulvariablen
    pnModDelVar('FlashChatBridge');
    // Fertig
    return true;
}
Beispiel #2
0
function dplink_delete()
{
    pnModDelVar('dplink', 'url');
    pnModDelVar('dplink', 'use_window');
    pnModDelVar('dplink', 'use_postwrap');
    return true;
}
Beispiel #3
0
function postcalendar_admin_updateconfig()
{
    if (!PC_ACCESS_ADMIN) {
        return _POSTCALENDAR_NOAUTH;
    }
    list($pcTime24Hours, $pcEventsOpenInNewWindow, $pcUseInternationalDates, $pcFirstDayOfWeek, $pcDayHighlightColor, $pcUsePopups, $pcAllowDirectSubmit, $pcListHowManyEvents, $pcDisplayTopics, $pcEventDateFormat, $pcTemplate, $pcAllowSiteWide, $pcAllowUserCalendar, $pcTimeIncrement, $pcUseCache, $pcCacheLifetime, $pcDefaultView, $pcNotifyAdmin, $pcNotifyEmail) = pnVarCleanFromInput('pcTime24Hours', 'pcEventsOpenInNewWindow', 'pcUseInternationalDates', 'pcFirstDayOfWeek', 'pcDayHighlightColor', 'pcUsePopups', 'pcAllowDirectSubmit', 'pcListHowManyEvents', 'pcDisplayTopics', 'pcEventDateFormat', 'pcTemplate', 'pcAllowSiteWide', 'pcAllowUserCalendar', 'pcTimeIncrement', 'pcUseCache', 'pcCacheLifetime', 'pcDefaultView', 'pcNotifyAdmin', 'pcNotifyEmail');
    // make sure we enter something into the DB
    if (!isset($pcTime24Hours)) {
        $pcTime24Hours = '0';
    }
    if (!isset($pcEventsOpenInNewWindow)) {
        $pcEventsOpenInNewWindow = '0';
    }
    if (!isset($pcUseInternationalDates)) {
        $pcUseInternationalDates = '0';
    }
    if (!isset($pcFirstDayOfWeek)) {
        $pcFirstDayOfWeek = '0';
    }
    if (!isset($pcUsePopups)) {
        $pcUsePopups = '0';
    }
    if (!isset($pcAllowDirectSubmit)) {
        $pcAllowDirectSubmit = '0';
    }
    if (!isset($pcDisplayTopics)) {
        $pcDisplayTopics = '0';
    }
    if (!isset($pcTemplate)) {
        $pcTemplate = 'default';
    }
    if (!isset($pcAllowSiteWide)) {
        $pcAllowSiteWide = '0';
    }
    if (!isset($pcAllowUserCalendar)) {
        $pcAllowUserCalendar = '0';
    }
    if (!isset($pcUseCache)) {
        $pcUseCache = '0';
    }
    if (!isset($pcDefaultView)) {
        $pcDefaultView = 'month';
    }
    if (empty($pcCacheLifetime)) {
        $pcCacheLifetime = '3600';
    }
    if (empty($pcDayHighlightColor)) {
        $pcDayHighlightColor = '#EEEEEE';
    }
    if (empty($pcListHowManyEvents)) {
        $pcListHowManyEvents = '15';
    }
    if (empty($pcEventDateFormat)) {
        $pcEventDateFormat = '%Y-%m-%d';
    }
    if (empty($pcTimeIncrement)) {
        $pcTimeIncrement = '15';
    }
    if (empty($pcNotifyAdmin)) {
        $pcNotifyAdmin = '0';
    }
    if (empty($pcNotifyEmail)) {
        $pcNotifyEmail = pnConfigGetVar('adminmail');
    }
    // delete the old vars - we're doing this because PostNuke variable
    // handling sometimes has old values in the $GLOBALS we need to clear
    pnModDelVar(__POSTCALENDAR__, 'pcTime24Hours');
    pnModDelVar(__POSTCALENDAR__, 'pcEventsOpenInNewWindow');
    pnModDelVar(__POSTCALENDAR__, 'pcUseInternationalDates');
    pnModDelVar(__POSTCALENDAR__, 'pcFirstDayOfWeek');
    pnModDelVar(__POSTCALENDAR__, 'pcDayHighlightColor');
    pnModDelVar(__POSTCALENDAR__, 'pcUsePopups');
    pnModDelVar(__POSTCALENDAR__, 'pcAllowDirectSubmit');
    pnModDelVar(__POSTCALENDAR__, 'pcListHowManyEvents');
    pnModDelVar(__POSTCALENDAR__, 'pcDisplayTopics');
    pnModDelVar(__POSTCALENDAR__, 'pcEventDateFormat');
    pnModDelVar(__POSTCALENDAR__, 'pcTemplate');
    pnModDelVar(__POSTCALENDAR__, 'pcAllowSiteWide');
    pnModDelVar(__POSTCALENDAR__, 'pcAllowUserCalendar');
    pnModDelVar(__POSTCALENDAR__, 'pcTimeIncrement');
    pnModDelVar(__POSTCALENDAR__, 'pcDefaultView');
    pnModDelVar(__POSTCALENDAR__, 'pcUseCache');
    pnModDelVar(__POSTCALENDAR__, 'pcCacheLifetime');
    pnModDelVar(__POSTCALENDAR__, 'pcNotifyAdmin');
    pnModDelVar(__POSTCALENDAR__, 'pcNotifyEmail');
    // set the new variables
    pnModSetVar(__POSTCALENDAR__, 'pcTime24Hours', $pcTime24Hours);
    pnModSetVar(__POSTCALENDAR__, 'pcEventsOpenInNewWindow', $pcEventsOpenInNewWindow);
    pnModSetVar(__POSTCALENDAR__, 'pcUseInternationalDates', $pcUseInternationalDates);
    pnModSetVar(__POSTCALENDAR__, 'pcFirstDayOfWeek', $pcFirstDayOfWeek);
    pnModSetVar(__POSTCALENDAR__, 'pcDayHighlightColor', $pcDayHighlightColor);
    pnModSetVar(__POSTCALENDAR__, 'pcUsePopups', $pcUsePopups);
    pnModSetVar(__POSTCALENDAR__, 'pcAllowDirectSubmit', $pcAllowDirectSubmit);
    pnModSetVar(__POSTCALENDAR__, 'pcListHowManyEvents', $pcListHowManyEvents);
    pnModSetVar(__POSTCALENDAR__, 'pcDisplayTopics', $pcDisplayTopics);
    pnModSetVar(__POSTCALENDAR__, 'pcEventDateFormat', $pcEventDateFormat);
    pnModSetVar(__POSTCALENDAR__, 'pcTemplate', $pcTemplate);
    pnModSetVar(__POSTCALENDAR__, 'pcAllowSiteWide', $pcAllowSiteWide);
    pnModSetVar(__POSTCALENDAR__, 'pcAllowUserCalendar', $pcAllowUserCalendar);
    pnModSetVar(__POSTCALENDAR__, 'pcTimeIncrement', $pcTimeIncrement);
    pnModSetVar(__POSTCALENDAR__, 'pcDefaultView', $pcDefaultView);
    pnModSetVar(__POSTCALENDAR__, 'pcUseCache', $pcUseCache);
    pnModSetVar(__POSTCALENDAR__, 'pcCacheLifetime', $pcCacheLifetime);
    pnModSetVar(__POSTCALENDAR__, 'pcNotifyAdmin', $pcNotifyAdmin);
    pnModSetVar(__POSTCALENDAR__, 'pcNotifyEmail', $pcNotifyEmail);
    $tpl = new pcSmarty();
    $tpl->clear_all_cache();
    return postcalendar_admin_modifyconfig('<center>' . _PC_UPDATED . '</center>');
}
Beispiel #4
0
/**
 * Module delete
 */
function mediashare_delete()
{
    $tables = array('albums', 'media', 'keywords', 'mediastore', 'mediadb', 'mediahandlers', 'sources', 'access', 'setup', 'invitation');
    // Delete the mediashare tables
    foreach ($tables as $table) {
        if (!DBUtil::dropTable("mediashare_{$table}")) {
            return false;
        }
    }
    pnModDelVar('mediashare');
    $sql = "DROP PROCEDURE mediashareUpdateNestedSetValuesRec";
    DBUtil::executeSQL($sql);
    $sql = "DROP PROCEDURE mediashareUpdateNestedSetValues";
    DBUtil::executeSQL($sql);
    // Deletion successful
    return true;
}
Beispiel #5
0
/**
 * Delete module.
 * 
 * @return true on successful module deletion, else false.
 */
function Meds_delete()
{
    // Get database connection and tables references.
    $dbconn =& pnDBGetConn(true);
    $pntable =& pnDBGetTables();
    // Create a new data object.
    $dict =& NewDataDictionary($dbconn);
    // The SQL to delete all module tables is setup inside $schema.
    // Notable is that table names are passed directly by reference
    // instead of pre-assigning the references to an intermediary
    // variable.  Setting up the tables under $schema allows for a loop
    // to delete all tables with only a single block of table-deletion
    // and error-checking code.
    $schema[] = $dict->DropTableSQL(&$pntable['rx_meds']);
    $schema[] = $dict->DropTableSQL(&$pntable['rx_preserve']);
    $schema[] = $dict->DropTableSQL(&$pntable['rx_company']);
    $schema[] = $dict->DropTableSQL(&$pntable['rx_chem']);
    $schema[] = $dict->DropTableSQL(&$pntable['rx_moa']);
    // Loop through $schema array, executing each and
    // checking for errors along the way.  Fails on error.
    foreach ($schema as $sqlarray) {
        if ($dict->ExecuteSQLArray($sqlarray) != 2) {
            pnSessionSetVar('errormsg', _MEDS_INI_DROP_TABLE_FAILURE);
            return false;
        }
    }
    // Delete any lingering module variables.
    pnModDelVar('Meds');
    // Module deleted.
    return true;
}
/**
 * delete the template module
 * This function is only ever called once during the lifetime of a particular
 * module instance
 */
function template_delete()
{
    // Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()
    // return arrays but we handle them differently.  For pnDBGetConn()
    // we currently just want the first item, which is the official
    // database handle.  For pnDBGetTables() we want to keep the entire
    // tables array together for easy reference later on
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    // Drop the table - for such a simple command the advantages of separating
    // out the SQL statement from the Execute() command are minimal, but as
    // this has been done elsewhere it makes sense to stick to a single method
    $sql = "DROP TABLE {$pntable['template']}";
    $dbconn->Execute($sql);
    // Check for an error with the database code, and if so set an
    // appropriate error message and return
    if ($dbconn->ErrorNo() != 0) {
        // Report failed deletion attempt
        return false;
    }
    // Delete any module variables
    pnModDelVar('Template', 'itemsperpage');
    pnModDelVar('Template', 'bold');
    // Deletion successful
    return true;
}
Beispiel #7
0
function Lenses_delete()
{
    // Get a reference to the database connection and PN tables.
    $dbconn =& pnDBGetConn(true);
    $pntable =& pnDBGetTables();
    // Create a new data object.
    $dict =& NewDataDictionary($dbconn);
    // The SQL to delete all module tables is setup inside $schema.
    // Notable is that table names are passed directly by reference
    // instead of pre-assigning the references to an intermediary
    // variable.  Setting up the tables as $schema allows for a loop
    // to delete all tables with only a single block of table-deletion
    // and error-checking code.
    $schema[] = $dict->DropTableSQL(&$pntable['lenses']);
    $schema[] = $dict->DropTableSQL(&$pntable['lenses_companies']);
    $schema[] = $dict->DropTableSQL(&$pntable['lenses_polymers']);
    // Loop through $schema array.
    foreach ($schema as $sqlarray) {
        // Run SQL query and check for database error.
        if ($dict->ExecuteSQLArray($sqlarray) != 2) {
            // Set an error message.
            pnSessionSetVar('errormsg', _LENSES_DROP_TABLE_FAILURE);
            // Report failure.
            return false;
        }
    }
    // Delete any lingering module variables.
    pnModDelVar('Lenses');
    // Module deletion successful.  Report success.
    return true;
}
/**
* delete a configuration variable
*
* @param name $ the name of the variable
* @return bool true on success, false on failure
*/
function pnConfigDelVar($name)
{
    if (!isset($name)) {
        return false;
    }
    // The database parameter are not allowed to be deleted
    if (empty($name) || $name == 'dbtype' || $name == 'dbhost' || $name == 'dbuname' || $name == 'dbpass' || $name == 'dbname' || $name == 'system' || $name == 'prefix' || $name == 'encoded') {
        return false;
    }
    // set the variable
    pnModDelVar(_PN_CONFIG_MODULE, $name);
    // Update my vars
    unset($GLOBALS['pnconfig'][$name]);
    // success
    return true;
}
Beispiel #9
0
/**
 *	Deletes an install of PostCalendar
 *
 *	This function removes PostCalendar from you
 *	PostNuke install and should be accessed via
 *	the PostNuke Admin interface
 *
 *	@return  boolean	true/false
 *	@access  public
 *	@author  Roger Raymond <*****@*****.**>
 *	@copyright	The PostCalendar Team 2002
 */
function postcalendar_delete()
{
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    $events_table = $pntable['postcalendar_events'];
    $cat_table = $pntable['postcalendar_categories'];
    $blocks_table = $pntable['blocks'];
    $blocks_column =& $pntable['blocks_column'];
    // get the module id
    $modid = pnModGetIDFromName(__POSTCALENDAR__);
    // remove the PostCalendar events table
    $sql = "DROP TABLE {$events_table}";
    $dbconn->Execute($sql);
    if ($dbconn->ErrorNo() != 0) {
        pnSessionSetVar('errormsg', $dbconn->ErrorMsg());
        return false;
    }
    // remove the PostCalendar categories table
    $sql = "DROP TABLE {$cat_table}";
    $dbconn->Execute($sql);
    if ($dbconn->ErrorNo() != 0) {
        pnSessionSetVar('errormsg', $dbconn->ErrorMsg());
        return false;
    }
    // remove all the PostCalendar variables from the DB
    pnModDelVar(__POSTCALENDAR__, 'pcTime24Hours');
    pnModDelVar(__POSTCALENDAR__, 'pcEventsOpenInNewWindow');
    pnModDelVar(__POSTCALENDAR__, 'pcUseInternationalDates');
    pnModDelVar(__POSTCALENDAR__, 'pcFirstDayOfWeek');
    pnModDelVar(__POSTCALENDAR__, 'pcDayHighlightColor');
    pnModDelVar(__POSTCALENDAR__, 'pcUsePopups');
    pnModDelVar(__POSTCALENDAR__, 'pcDisplayTopics');
    pnModDelVar(__POSTCALENDAR__, 'pcAllowDirectSubmit');
    pnModDelVar(__POSTCALENDAR__, 'pcListHowManyEvents');
    pnModDelVar(__POSTCALENDAR__, 'pcTimeIncrement');
    pnModDelVar(__POSTCALENDAR__, 'pcAllowSiteWide');
    pnModDelVar(__POSTCALENDAR__, 'pcAllowUserCalendar');
    pnModDelVar(__POSTCALENDAR__, 'pcEventDateFormat');
    pnModDelVar(__POSTCALENDAR__, 'pcTemplate');
    pnModDelVar(__POSTCALENDAR__, 'pcUseCache');
    pnModDelVar(__POSTCALENDAR__, 'pcCacheLifetime');
    pnModDelVar(__POSTCALENDAR__, 'pcDefaultView');
    pnModDelVar(__POSTCALENDAR__, 'pcSafeMode');
    pnModDelVar(__POSTCALENDAR__, 'pcNotifyAdmin');
    pnModDelVar(__POSTCALENDAR__, 'pcNotifyEmail');
    // remove any blocks associated with PostCalendar
    // Seems the core does not clean up installed blocks so I will.
    // I appologize for accessing core tables directly.
    $sql = "DELETE FROM {$blocks_table} WHERE {$blocks_column['mid']} = '{$modid}'";
    $dbconn->Execute($sql);
    if ($dbconn->ErrorNo() != 0) {
        pnSessionSetVar('errormsg', $dbconn->ErrorMsg());
        return false;
    }
    // Deletion successful
    return true;
}