function setDays()
{
    $days = get_ajax_value('days');
    $values = get_ajax_value('values');
    $days = explode(',', $days);
    $values = explode(',', $values);
    for ($r = 1; $r < sizeof($days); $r++) {
        setDay($days[$r], $values[$r]);
    }
}
 case 'assignAllUsers':
     G::LoadClass('groups');
     $oGroup = new Groups();
     $aUsers = explode(',', $_POST['aUsers']);
     for ($i = 0; $i < count($aUsers); $i++) {
         $oGroup->addUserToGroup($_POST['GRP_UID'], $aUsers[$i]);
     }
     break;
 case 'ofToAssignUser':
     G::LoadClass('groups');
     $oGroup = new Groups();
     $oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);
     break;
 case 'verifyGroupname':
     $_POST['sOriginalGroupname'] = get_ajax_value('sOriginalGroupname');
     $_POST['sGroupname'] = get_ajax_value('sGroupname');
     if ($_POST['sOriginalGroupname'] == $_POST['sGroupname']) {
         echo '0';
     } else {
         require_once 'classes/model/Groupwf.php';
         G::LoadClass('Groupswf');
         $oGroup = new Groupwf();
         $oCriteria = $oGroup->loadByGroupname($_POST['sGroupname']);
         $oDataset = GroupwfPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $aRow = $oDataset->getRow();
         if (!$aRow) {
             echo '0';
         } else {
             echo '1';
Exemple #3
0
 G::LoadInclude('ajax');
 if (isset($_POST['form'])) {
     $_POST = $_POST['form'];
 }
 if (isset($_REQUEST['function'])) {
     //$value= $_POST['function'];
     $value = get_ajax_value('function');
 } else {
     //$value= $_POST['functions'];
     $value = get_ajax_value('functions');
 }
 switch ($value) {
     case 'verifyUsername':
         //print_r($_POST); die;
         $_POST['sOriginalUsername'] = get_ajax_value('sOriginalUsername');
         $_POST['sUsername'] = get_ajax_value('sUsername');
         if ($_POST['sOriginalUsername'] == $_POST['sUsername']) {
             echo '0';
         } else {
             require_once 'classes/model/Users.php';
             G::LoadClass('Users');
             $oUser = new Users();
             $oCriteria = $oUser->loadByUsername($_POST['sUsername']);
             $oDataset = UsersPeer::doSelectRS($oCriteria);
             $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
             $oDataset->next();
             $aRow = $oDataset->getRow();
             //print_r($aRow); die;
             //if (!$aRow)
             if (!is_array($aRow)) {
                 echo '0';
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 *
 */
ini_set("soap.wsdl_cache_enabled", "0");
// enabling WSDL cache
G::LoadClass('ArrayPeer');
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_FACTORY') != 1) {
    G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
    //G::header('location: ../login/login');
    die;
}
G::LoadInclude('ajax');
//G::pr($_SESSION);
$_POST['action'] = get_ajax_value('action');
if ($_POST['action'] == '') {
    $_POST['action'] = isset($_GET['action']) ? $_GET['action'] : '';
}
switch ($_POST['action']) {
    case 'showForm':
        global $G_PUBLISH;
        $xmlform = isset($_POST['wsID']) ? 'setup/ws' . $_POST['wsID'] : '';
        if (file_exists(PATH_XMLFORM . $xmlform . '.xml')) {
            global $_DBArray;
            $_DBArray = isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : '';
            $G_PUBLISH = new Publisher();
            $fields['SESSION_ID'] = isset($_SESSION['WS_SESSION_ID']) ? $_SESSION['WS_SESSION_ID'] : '';
            $fields['ACTION'] = $_POST['wsID'];
            $G_PUBLISH->AddContent('xmlform', 'xmlform', $xmlform, '', $fields, '../setup/webServicesAjax');
            G::RenderPage('publish', 'raw');
        }
        parse_str(get_ajax_value('update'), $fieldup);
        foreach ($fieldup as $key => $value) {
            $field['new' . $key] = urldecode($value);
            //join
        }
        $ntable->ses->execute($ntable->replaceDataField($ntable->sqlUpdate, $field));
        break;
    case "insert":
        $ntable->prepareQuery();
        parse_str(get_ajax_value('field'), $field);
        foreach ($field as $key => $value) {
            $field[$key] = urldecode($value);
        }
        $ntable->ses->execute($ntable->replaceDataField($ntable->sqlInsert, $field));
        break;
    case "printForm":
        parse_str(get_ajax_value('field'), $field);
        parse_str(get_ajax_value('field'), $field);
        foreach ($field as $key => $value) {
            $field[$key] = urldecode($value);
        }
        $ntable->printForm(get_ajax_value('filename'), $field);
        return;
}
$ntable->renderTable('content');
G::LoadClass('configuration');
$dbc = new DBConnection();
$conf = new Configuration($dbc, $ntable);
$conf->setConfig($ntable->__Configuration, $ntable, $conf->aConfig);
$conf->saveConfig('pagedTable', $ntable->__OBJ_UID, '', $_SESSION['USER_LOGGED'], '');
Exemple #6
0
 * 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.
 * 
 */
G::Loadinclude('ajax');
$function = get_ajax_value('function');
$searchText = get_ajax_value('text');
$userName = get_ajax_value('userName');
$authSource = get_ajax_value('authSource');
$dn = get_ajax_value('dn');
$fullname = get_ajax_value('fullname');
$email = get_ajax_value('email');
$roles = get_ajax_value('roles');
switch ($function) {
    case 'searchText':
        searchText($searchText);
        break;
    case 'validUser':
        validUser($searchText);
        break;
    case 'createUser':
        createUser($userName, $authSource, $dn, $fullname, $email, $roles);
        break;
}
function createUser($userName, $authSource, $dn, $fullname, $email, $roles)
{
    global $DB_MODULE;
    // :(
     } else {
         $oDpto = new Department();
         $oCriteria = $oDpto->loadByGroupname($_POST['sGroupname']);
         $oDataset = DepartmentPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $aRow = $oDataset->getRow();
         if (!$aRow) {
             echo '0';
         } else {
             echo '1';
         }
     }
     break;
 case 'showUnAssignedUsers':
     $_POST['UID'] = get_ajax_value('UID');
     require_once 'classes/class.xmlfield_InputPM.php';
     if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
         return $RBAC_Response;
     }
     G::LoadClass('departments');
     $oDept = new Department();
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('propeltable', 'departments/paged-table3', 'departments/departments_AddUnAssignedUsers', $oDept->getAvailableUsersCriteria(''));
     G::RenderPage('publish', 'raw');
     break;
 case 'departmentList':
     global $RBAC;
     $aDEPTS = $RBAC->getAllUsersByDepartment();
     $tree_depart = LookForChildren('', 0, $aDEPTS);
     echo G::json_encode($tree_depart);
 * 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.
 *
 */
try {
    G::LoadInclude('ajax');
    if (isset($_POST['form'])) {
        $_POST = $_POST['form'];
    }
    $_POST['function'] = get_ajax_value('function');
    switch ($_POST['function']) {
        case 'getStarted_save':
            require_once 'classes/model/Configuration.php';
            $aData['CFG_UID'] = 'getStarted';
            $aData['OBJ_UID'] = '';
            $aData['CFG_VALUE'] = '1';
            $aData['PRO_UID'] = '';
            $aData['USR_UID'] = '';
            $aData['APP_UID'] = '';
            $oConfig = new Configuration();
            $oConfig->create($aData);
            break;
    }
} catch (Exception $oException) {
    die($oException->getMessage());
 * 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.
 */
ini_set('display_errors', 'off');
G::LoadInclude('ajax');
$function = get_ajax_value('function');
$cat = get_ajax_value('cat');
$node = get_ajax_value('node');
$lang = get_ajax_value('lang');
$langLabel = get_ajax_value('langLabel');
$text = get_ajax_value('text');
$table = "TRANSLATION";
$dbc = new DBConnection();
$ses = new DBSession($dbc);
switch ($function) {
    case "editLabel":
    case "changeLabel":
        $query = $ses->execute("select * from {$table} where TRN_CATEGORY='{$cat}' and TRN_ID='{$node}' and TRN_LANG='{$lang}'", false);
        if ($query->count() === 0) {
            echo "Not found {$cat}:{$node}:{$lang} in table '{$table}'";
            return;
        }
        if ($query->count() > 1) {
            echo "The {$cat}:{$node}:{$lang} in table '{$table}' is not unique";
            return;
        }
  $filename = $Row['REQ_FILENAME'];
}

if ($HTTP_GET_VARS['__dynaform__'] == '')
  $HTTP_SESSION_VARS['CURRENT_REQ_DYNAFORM'] = $Row['UID'];

}
*/
$filename = 'rbac/userAssignRole';
$fieldName = get_ajax_value('field');
$fieldValue = get_ajax_value('value');
$fieldParent = get_ajax_value('parent');
$function = get_ajax_value('function');
$appid = get_ajax_value('application');
$Dynaform = get_ajax_value('Dynaform');
$InitValue = get_ajax_value('InitValue');
switch ($function) {
    case 'text':
        fillText($fieldName, $fieldParent, $fieldValue, $appid, $filename);
        break;
    case 'dropdown':
        fillDropdown($fieldName, $fieldParent, $fieldValue, $appid, $filename, $InitValue);
        break;
    default:
        echo '<small>none</small>';
}
function fillCaption($fieldName, $fieldParent, $valueRecived, $appid, $filename)
{
    $options = reload($fieldName, $fieldParent, $valueRecived, $appid, $filename);
    header("Content-Type: text/xml");
    print '<?xml version="1.0" encoding="UTF-8"?>