Esempio n. 1
0
        break;
    case -1:
        G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
        G::header('location: ../login/login');
        die;
        break;
}
G::LoadClass("system");
$id = strip_tags(str_replace(' ', '_', trim($_POST['form']['NAME'])));
$desc = $_POST['form']['DESCRIPTION'];
$fileObj = PATH_SKINS . $id . '.cnf';
if (!file_exists($fileObj)) {
    $oConf = new stdClass();
    $oConf->name = $id;
    $oConf->description = $desc;
    $oConf->version = 1;
    file_put_contents($fileObj, serialize($oConf));
}
$oConf = unserialize(file_get_contents($fileObj));
$contentPHP = file_get_contents(PATH_SKINS . 'green.php');
$contentPHP = str_replace('green.html', $id . '.html', $contentPHP);
file_put_contents(PATH_SKINS . $id . '.php', $contentPHP);
$contentHTML = file_get_contents(PATH_SKINS . 'green.html');
$contentHTML = str_replace('green', $id, $contentHTML);
file_put_contents(PATH_SKINS . $id . '.html', $contentHTML);
$pathImages = PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP;
G::mk_dir($pathImages);
xcopy(PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP);
xcopy(PATH_HTML . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP, PATH_HTML . 'skins' . PATH_SEP . $id . PATH_SEP . 'images' . PATH_SEP);
G::Header('Location: ../../' . $id . '/setup/skinsList');
 * Copyright (C) 2004 - 2008 Colosa Inc.23
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
//to do: improve the way to pass two or more parameters in the paged-table ( link )
$aux = explode('|', $_GET['id']);
$category = str_replace('"', '', $aux[0]);
$id = str_replace('"', '', $aux[1]);
require_once "classes/model/Translation.php";
//if exists the row in the database propel will update it, otherwise will insert.
$tr = TranslationPeer::retrieveByPK($category, $id, 'en');
if (is_object($tr) && get_class($tr) == 'Translation') {
    $tr->delete();
}
//  else
G::Header('location: translations');
Esempio n. 3
0
 <?php 
try {
    $CalendarUid = $_GET['id'];
    G::LoadClass('calendar');
    $calendarObj = new calendar();
    $calendarObj->deleteCalendar($CalendarUid);
    G::Header('location: calendarList');
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish', 'blank');
}
 public function installLicense($path, $redirect = true, $includeExpired = true)
 {
     $application = new license_application($path, false, true, false, true, true);
     $results = $application->validate(false, false, "", "", "80", true);
     //if the result is ok then it is saved into DB
     $res = $results['RESULT'];
     if ($res == 'EMPTY') {
         return false;
     }
     if (!$includeExpired) {
         if ($res == 'EXPIRED') {
             return false;
         }
     }
     if ($res != 'OK' && $res != 'EXPIRED' && $res != 'TMINUS') {
         G::SendTemporalMessage('ID_ISNT_LICENSE', 'tmp-info', 'labels');
         return false;
     } else {
         G::LoadClass('serverConfiguration');
         $oServerConf =& serverConf::getSingleton();
         $oServerConf->setProperty('ACTIVE_LICENSE', array(SYS_SYS => $path));
         $this->saveDataLicense($results, $path, $redirect);
         if ($redirect) {
             G::Header('location: ../enterprise/addonsStore');
         } else {
             return true;
         }
     }
 }
        $tr->setCategoryName($CategoryName);
        $tr->setCategoryIcon($CategoryIcon);
        if ($tr->validate()) {
            // we save it, since we get no validation errors, or do whatever else you like.
            $res = $tr->save();
        } else {
            // Something went wrong. We can now get the validationFailures and handle them.
            $msg = '';
            $validationFailuresArray = $tr->getValidationFailures();
            foreach ($validationFailuresArray as $objValidationFailure) {
                $msg .= $objValidationFailure->getMessage() . "<br/>";
            }
            //return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
        }
        //return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
        //to do: uniform  coderror structures for all classes
        //if ( $res['codError'] < 0 ) {
        //  G::SendMessageText ( $res['message'] , 'error' );
        //}
        G::Header('location: processCategoryList');
    } else {
        // G::SendTemporalMessage("El registro ya existe", "warning", 'labels');
        G::Header('location: processCategoryList');
        die;
    }
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish', 'blank');
}
 <?php 
try {
    $form = $_POST['form'];
    $FolderUid = $form['FOLDER_UID'];
    require_once "classes/model/AppFolder.php";
    //if exists the row in the database propel will update it, otherwise will insert.
    $tr = AppFolderPeer::retrieveByPK($FolderUid);
    if (is_object($tr) && get_class($tr) == 'AppFolder') {
        $tr->delete();
    }
    G::Header('location: appFolderList');
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish', 'blank');
}
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
$pluginFile = $_GET['id'];
G::LoadClass('plugin');
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$details = $oPluginRegistry->getPluginDetails($pluginFile);
try {
    $Fields = $oPluginRegistry->updateFieldsForPageSetup($details->sNamespace, $_POST);
    $str = "{$Fields} fields saved successfully!";
    G::SendTemporalMessage($str, 'info', 'string', 3, 100);
    G::Header("location: pluginsSetup?id={$pluginFile}");
} catch (Exception $e) {
    $G_MAIN_MENU = 'processmaker';
    $G_ID_MENU_SELECTED = 'SETUP';
    $G_SUB_MENU = 'setup';
    $G_ID_SUB_MENU_SELECTED = 'PLUGINS';
    $G_PUBLISH = new Publisher();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish');
}