<table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:100%">
  <tr> 
	<td valign="top" width="100%" class="scms_confirm_delete_cell" height="100%">
<?php 
    # check warnings
    # 1. if exist any user with that role, then give a warning
    $data_count = 0;
    ############ permissions
    $sql = $site->db->prepare("SELECT COUNT(*) FROM user_roles WHERE role_id=?", $site->fdat['role_id']);
    $sth = new SQL($sql);
    $data_count = $sth->fetchsingle();
    if ($data_count > 0) {
        # show error message
        #		echo "<font color=red>".$site->sys_sona(array(sona => "Permission denied", tyyp=>"editor"))."</font><br><br>";
        echo $site->sys_sona(array(sona => "Children count", tyyp => "admin")) . ": <font color=red><b>" . $data_count . "</b></font><br><br>";
    }
    # show confirmation
    echo $site->sys_sona(array(sona => "kustuta", tyyp => "editor")) . " \"<b>" . $role['name'] . "</b>\"? ";
    echo $site->sys_sona(array(sona => "are you sure?", tyyp => "admin"));
    $allow_delete = 1;
    ?>
	</td>
  </tr>
  <tr align="right"> 
    <td valign="top" colspan=2 > 
		<?php 
    if ($allow_delete) {
        ?>
            <input type="button" value="<?php 
        echo $site->sys_sona(array(sona => "kustuta", tyyp => "editor"));
         if ($objekt->permission['R'] && $objekt->permission['U']) {
             $access = 1;
         }
     }
     # NEW OBJECT: tab is denied
 }
 // editing for public and shared folders is denied
 if ($site->fdat['tab'] == 'object' && ($objekt->all['sys_alias'] == 'public' || $objekt->all['sys_alias'] == 'shared')) {
     $access = 0;
 }
 ####################
 # access denied
 if (!$access) {
     new Log(array('action' => 'create', 'type' => 'WARNING', 'objekt_id' => $objekt->objekt_id, 'message' => $objekt ? sprintf("Access denied: attempt to edit %s '%s' (ID = %s)", ucfirst(translate_en($objekt->all['klass'])), $objekt->pealkiri(), $objekt->objekt_id) : sprintf("Access denied: attempt to create %s under restricted category ID = %s", ucfirst(translate_en($objekt->all['klass'])), $site->fdat['parent_id'])));
     ####### print error html
     print_error_html(array("message" => $site->sys_sona(array(sona => "access denied", tyyp => "editor"))));
     if ($site->user) {
         $site->user->debug->print_msg();
     }
     if ($site->guest) {
         $site->guest->debug->print_msg();
     }
     $site->debug->print_msg();
     ########### EXIT
     exit;
 }
 # / ACCESS allowed/denied
 ###########################
 ###########################
 # GO ON with real work
 #################
####################
# access denied
if (!$access) {
    ####### write log
    if ($site->fdat['op'] == 'new' || $site->fdat['op'] == 'copy') {
        $text = sprintf("Access denied: attempt to create group under restricted group ID = %s", $site->fdat['group_id']);
        new Log(array('action' => 'create', 'component' => 'User groups', 'type' => 'WARNING', 'message' => $text));
    } elseif ($site->fdat['op'] == 'delete') {
        new Log(array('action' => 'delete', 'component' => 'User groups', 'type' => 'WARNING', 'message' => $text));
        $text = sprintf("Access denied: attempt to delete group '%s' (ID = %s)", $group->name, $group->id);
    } else {
        new Log(array('action' => 'update', 'component' => 'User groups', 'type' => 'WARNING', 'message' => $text));
        $text = sprintf("Access denied: attempt to edit group '%s' (ID = %s)", $group->name, $group->id);
    }
    ####### print error html
    print_error_html(array("message" => $site->sys_sona(array(sona => "access denied", tyyp => "editor"))));
    ####### print debug
    if ($site->user) {
        $site->user->debug->print_msg();
    }
    if ($site->guest) {
        $site->guest->debug->print_msg();
    }
    $site->debug->print_msg();
    ########### EXIT
    exit;
}
# / ACCESS allowed/denied
###########################
# / PERMISSIONS CHECK
####################################
        $sql = $site->db->prepare("UPDATE object_profiles SET data=? WHERE profile_id=?", $update_data, $site->fdat['profile_id']);
        $sth = new SQL($sql);
        $site->debug->msg($sth->debug->get_msgs());
    }
    # if source_table
    header("Location: " . (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $site->CONF['hostname'] . $site->self . "?profile_id=" . $site->fdat['profile_id']);
}
# / SYNC with real TABLE in database
##################
$site->fdat['profile_id'] = (int) $site->fdat['profile_id'];
$site->fdat['source_table'] = htmlspecialchars(xss_clean($site->fdat['source_table']));
$site->fdat['did'] = htmlspecialchars(xss_clean($site->fdat['did']));
################ get profile data
$profile_def = $site->get_profile(array(id => $site->fdat['profile_id']));
if ($profile_def['name']) {
    $breadcrumb_focus_str = ",'" . $site->sys_sona(array(sona => $profile_def['name'], tyyp => "custom")) . "'";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title><?php 
echo $site->title;
?>
 <?php 
echo $site->cms_version;
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $site->encoding;
		$.ajax({
		    url: site_url + '/admin/ajax_response.php',
		    cache: false,
		    data: data,
		    type: 'POST',
		    dataType: 'json',
		    timeout: 10000,
		    error: function(XMLHttpRequest, textStatus, errorThrown)
		    {
		    	alert(textStatus);
				$('div#scms_content_cover').addClass('hidden');
		    },
		    success: function(response, textStatus)
		    {
				confirmDialog('<?php 
echo $site->sys_sona(array('sona' => 'sites_delete_confirm', 'tyyp' => 'admin'));
?>
 "' + sites[site_id].nimi + '"? ' + response.count + ' <?php 
echo $site->sys_sona(array('sona' => 'site_objects_will_be_deleted', 'tyyp' => 'admin'));
?>
!', function ()
				{
					$('div#scms_content_cover').removeClass('hidden');
					
					var data = {
				    	op: 'delete_site',
				    	site_id: site_id
					}
					
					$.extend(data, ajax_token);
					
Exemplo n.º 6
0
    echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
    ?>
/yld.js"></SCRIPT>
</head>
	<body class="popup_body" onLoad="this.focus()">

	<form name="editform" action="<?php 
    echo $site->self;
    ?>
" method=get>
<table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:100%">
  <tr> 
	<td valign="top" width="100%" class="scms_confirm_delete_cell" height="100%">
<?
	$objekt->load_sisu();
	echo $site->sys_sona(array(sona => "kustuta", tyyp=>"editor"))." \"<b>".substr($objekt->all['text'],0,20).(strlen($objekt->all['text'])>20?'...':'')."</b>\"? ";
	echo $site->sys_sona(array(sona => "are you sure?", tyyp=>"admin"));
	
?>
	</td>
  </tr>
  <tr align="right"> 
    <td valign="top" colspan=2 > 
            <input type="button" value="<?php 
    echo $site->sys_sona(array(sona => "kustuta", tyyp => "editor"));
    ?>
" onclick="javascript:document.getElementById('op2').value='deleteconfirmed';document.forms['editform'].submit();">
			<input type="button" value="<?php 
    echo $site->sys_sona(array(sona => "close", tyyp => "editor"));
    ?>
" onclick="javascript:window.close();"> 
function print_config_table()
{
    global $site;
    global $called_from_install_script;
    #	$called_from_install_script = true;
    if ($called_from_install_script) {
        $site = new Site(array(on_debug => 0));
        # force language to english when called from installation script:
        $site->keel = 1;
    }
    ###########################
    # Define groups here - different for install.php and admin-pages
    ###########################
    ## 1. Conf groups displayed during installation (install.php)
    if ($called_from_install_script) {
        $configuration_group = array("website_properties" => array("from_email", "default_mail"), 'aliases' => array('use_aliases'));
    } else {
        $site_properties_group = array('forums_and_comments' => array('allow_commenting', 'only_regusers_comment', 'comment_max_chars', 'check_for_captcha', 'feedbackform_check_for_captcha'));
        $configuration_group = array('users' => array('users_can_register', 'notification_about_new_user_enabled', 'default_pass_expire_days', 'users_require_safe_password', 'new_user_password'), 'users_login' => array('max_login_attempts', 'login_locked_time', 'login_duration_time', 'lock_inactive_user_after_x_days', 'allow_forgot_password'), 'forums_and_comments' => array('allow_commenting', 'only_regusers_comment', "default_comments", 'comment_max_chars', 'check_for_captcha', 'feedbackform_check_for_captcha'), 'mailing_list' => array('enable_mailing_list', 'maillist_sending_after_publishing', 'maillist_interval', 'maillist_sender_address', 'maillist_send_newer_than', 'maillist_reporter_address', 'add_new_user_to_mailinglists'), 'mailinglist_format' => array('maillist_format', 'mailinglist_sending_option', 'maillist_subject', 'maillist_article_title', 'maillist_article_content', 'maillist_header', 'maillist_footer'), 'feedbackforms_properties' => array('from_email', 'default_mail', 'subject', 'feedbackform_action', 'feedbackform_form_name', 'feedbackform_method'), "recycle_bin" => array("trash_expires"), 'aliases' => array('use_aliases', 'redirect_to_alias', 'replace_links_with_alias', 'alias_language_format', 'alias_trail_format'), 'timezone' => array('time_zone'), 'cache' => array('cache_expired', 'dont_cache_objects'), 'Filemanager' => array('fm_allow_multiple_upload'), 'logging' => array('save_site_log', 'save_error_log'), 'error_notifications' => array('send_error_notifiations_to', 'send_error_notifiations_to_superusers', 'send_error_notifiations_setting'), 'content_editing' => array("allow_change_position", 'context_menu_open_event'), 'protocol' => array("protocol", 'force_https_for_editing', 'force_https_for_admin'), 'session_and_timeouts' => array("php_max_execution_time", "php_memory_limit"), 'debugging' => array("display_errors_ip"), 'proxy' => array("proxy_server", "proxy_server_port"), 'Gallup' => array('gallup_ip_check'));
    }
    # conf groups for install.php or admin-pages
    ### icons:
    $icons = array("website_properties" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/actions/inweb.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "system" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "protocol" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "session_and_timeouts" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "debugging" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "proxy" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "logging" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "Gallup" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "recycle_bin" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/sysinfo.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "time_zones" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/html.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "gallery" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/images.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "content_editing" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/html.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "counter" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/counter.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "users" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/users/group.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "users_login" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/users/group.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "cache" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/cache.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "mailing_list" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/actions/mail_send.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "mailinglist_format" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/actions/mail_send.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>', "Gallup" => '<IMG SRC="' . ($called_from_install_script ? 'styles/default/' : $site->CONF['wwwroot'] . $site->CONF['styles_path'] . '/') . 'gfx/icons/16x16/mime/poll.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" align=absmiddle>');
    $group_one = array_keys($site_properties_group ? $site_properties_group : array());
    $group_two = array_keys($configuration_group);
    # put all config values into one array
    $is_visible = array_merge($group_one, $group_two);
    if ($site->fdat['group'] == '1') {
        //$group = &$site_properties_group;
    } else {
        $group =& $configuration_group;
    }
    if (!is_array($group)) {
        $group = array();
    }
    $sql = "SELECT nimi, sisu, kirjeldus, on_nahtav FROM config ";
    $sth = new SQL($sql);
    while ($tmp = $sth->fetch()) {
        # if this file is included from "install.php" then put real hostname & wwwroot values
        if ($called_from_install_script && $tmp[nimi] == "hostname" && $_POST["install"]) {
            $tmp[sisu] = $site->hostname;
        }
        if ($called_from_install_script && $tmp[nimi] == "wwwroot" && $_POST["install"]) {
            $tmp[sisu] = $site->wwwroot;
        }
        $v_config[$tmp[nimi]] = $tmp;
    }
    if ($site->fdat['group'] || $called_from_install_script) {
        ############################################################
        #"gallery", "users", "mailing_list", "cache", "counter"
        ############################################################
        foreach ($group as $grupp_name => $values) {
            if (is_array($values)) {
                $i = 0;
                echo "\r\n\t\t\t\t<tr class='scms_pane_header'>\r\n\t\t\t\t\t<td nowrap colspan=\"2\">" . $icons[$grupp_name] . "&nbsp;&nbsp;" . $site->sys_sona(array(sona => $grupp_name, tyyp => "admin")) . "</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t";
                foreach ($values as $config) {
                    $i++;
                    print_config_row($v_config[$config], $i);
                }
            }
        }
    }
    if (is_array($v_config) && !$site->fdat['group'] && !$called_from_install_script) {
        #################################################
        #"built_in_templates", "website_properties", "system"
        #################################################
        foreach ($group as $grupp_name => $values) {
            if (is_array($values)) {
                $i = 0;
                echo "\r\n\t\t\t\t<tr class='scms_pane_header'>\r\n\t\t\t\t\t<td nowrap colspan=\"2\">" . ($icons[$grupp_name] ? $icons[$grupp_name] . '&nbsp;' : '') . $site->sys_sona(array(sona => $grupp_name, tyyp => "admin")) . "</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t";
                foreach ($values as $config) {
                    $i++;
                    print_config_row($v_config[$config], $i);
                }
            }
        }
        if (!$called_from_install_script) {
            echo "\r\n\t\t\t\t<tr class='scms_pane_header'>\r\n\t\t\t\t\t<td  nowrap colspan=\"2\">Advanced</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t";
            $i = 0;
            foreach ($v_config as $conf_name => $tmp) {
                if (!$tmp['on_nahtav'] && !in_array($conf_name, $is_visible)) {
                    $i++;
                    print_config_row($tmp, $i);
                }
            }
        }
    }
}
    }
}
function can_user_change_translation($sst_id)
{
    return 1;
}
$adminpage_names = get_adminpage_name(array('script_name' => $site->script_name));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>

<title><?php 
echo $site->sys_sona(array('sona' => 'translations', 'tyyp' => 'admin'));
?>
</title>

<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $site->encoding;
?>
" />

<link rel="stylesheet" href="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/glossary.css" />

<!--[if IE 6]>
	<style type="text/css">
$class_path = "../classes/";
include $class_path . "port.inc.php";
#Get debug cookie muutuja
$debug = $_COOKIE["debug"] ? 1 : 0;
$site = new Site(array(on_debug => $debug, on_admin_keel => 1));
#################################
# check privileges
# only superuser can delete
if (!$site->user->allowed_adminpage()) {
    exit;
}
##### default table is "logi" (Site log)
if ($site->fdat['tbl'] == 'error_log') {
    $tbl = 'error_log';
    $time_field = 'time_of_error';
    $title = $site->sys_sona(array(sona => "Error Log", tyyp => "admin"));
} else {
    $tbl = 'sitelog';
    $time_field = 'date';
    $title = $site->sys_sona(array(sona => "Log", tyyp => "admin"));
}
#################################
# start html
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php 
echo $site->title;
?>
}
?>
	            					</td>
	            				</tr>
	            			</table>
	            		</div>
	            	</div>
	            	<div class="s_Page_title_bar">
						<table cellpadding="0" cellspacing="0">
							<tr>
								<td class="icon" width="16" style="padding-right: 3px;"><img src="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/gfx/icons/16x16/actions/swk_explorer.png" width="16" height="16"></td>
								<td class="title"><span><?php 
echo $site->sys_sona(array('sona' => 'explorer', 'tyyp' => 'admin'));
echo $swk_setup == 'general_site_explorer' ? ' (beta)' : '';
?>
</span></td>
							</tr>
						</table>
            		</div><!-- s_Page_title_bar -->
	            </td>
	        </tr>
	        <tr>
	            <td class="s_Page_container">
	                <div id="s_Content_container">
	                	<table cellpadding="0" cellspacing="0" class="tree">
	                		<thead>
	                			<tr>
	                				<?php 
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
  <!-- Toolbar -->
  <tr>
	<td class="scms_toolbar">
	
			<TABLE cellpadding=0 cellspacing=0 border=0>
			<TR>
			<?php 
######### SAVE button
?>
				<TD nowrap><a href="javascript:document.getElementById('selectform_op').value='save';document.forms['selectform'].submit();"><IMG SRC="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/gfx/icons/16x16/actions/filesave.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" id="pt"> <?php 
echo $site->sys_sona(array(sona => "salvesta", tyyp => "editor"));
?>
</a></TD>
			<?php 
######### NEW role button
?>
				<TD nowrap><a href="javascript:void(openpopup('edit_role.php?op=new','role','366','150'))"><IMG SRC="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/gfx/icons/16x16/actions/filenew.png" WIDTH="16" HEIGHT="16" BORDER="0" ALT="" id="pt"> <?php 
echo $site->sys_sona(array(sona => "new", tyyp => "editor"));
?>
</a></TD>

		  <?php 
############ edit role button ###########
 * @license		Mozilla Public License 1.1 (http://www.opensource.org/licenses/mozilla1.1.php)
 * 
 */
global $class_path;
$class_path = '../classes/';
include $class_path . 'port.inc.php';
include $class_path . 'adminpage.inc.php';
$site = new Site(array('on_debug' => $_COOKIE['debug'] ? 1 : 0, 'on_admin_keel' => 1));
include_once $class_path . 'picture.inc.php';
$object = new Objekt(array('objekt_id' => (int) $site->fdat['file_id'], 'on_sisu' => 1));
if ($object->all['relative_path']) {
    $object->all['fullpath'] = preg_replace('#/$#', '', $site->absolute_path) . $object->all['relative_path'];
}
if ($object->objekt_id && $object->all['fullpath']) {
    list($width, $height, $type, $attr) = getimagesize($object->all['fullpath']);
    $default_image = array('width' => $width, 'height' => $height, 'filepath' => (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $site->CONF['hostname'] . $site->CONF['wwwroot'] . '/' . str_replace($site->absolute_path, '', $object->all['fullpath']), 'name' => $site->sys_sona(array('sona' => 'original picture', 'tyyp' => 'Editor')) . ' (' . $width . 'x' . $height . ')');
    $definitions = array();
    $sql = 'select definition_id, value, name from config_images order by value desc';
    $result = new SQL($sql);
    while ($row = $result->fetch('ASSOC')) {
        $definitions[$row['definition_id']]['width'] = $row['value'];
        $definitions[$row['definition_id']]['name'] = $row['name'];
        if (!$definitions[$row['definition_id']]['width'] || $definitions[$row['definition_id']]['width'] > $width) {
            unset($definitions[$row['definition_id']]);
        } else {
            $definitions[$row['definition_id']]['height'] = round($height / ($width / $definitions[$row['definition_id']]['width']));
            $definitions[$row['definition_id']]['name'] = $site->sys_sona(array('sona' => 'image_definitions_' . $definitions[$row['definition_id']]['name'], 'tyyp' => 'Custom')) . ' (' . $definitions[$row['definition_id']]['width'] . 'x' . $definitions[$row['definition_id']]['height'] . ')';
            $pathinfo = pathinfo($object->all['fullpath']);
            $image_path = str_replace($site->absolute_path, '', $object->all['fullpath']);
            // create images
            $image = new ImageShopper($image_path);
Exemplo n.º 13
0
$log_actions = Log::getActionsArray();
// selected user
// get log records
$log_records = array();
$sql = $site->db->prepare("select * from sitelog where 1 {$sql_selected_user} {$sql_where_date} {$sql_search} order by date desc limit " . ($page - 1) * (int) $page_items . ", " . (int) $page_items);
//printr($sql);
$result = new SQL($sql);
while ($row = $result->fetch('ASSOC')) {
    $log_records[] = array('date' => $site->db->MySQL_ee_long($row['date']), 'username' => $users[$row['user_id']]['username'], 'objekt_id' => $row['objekt_id'], 'component' => $row['component'], 'type' => $log_types[$row['type']], 'action' => $log_actions[$row['action']], 'message' => $row['message']);
}
$adminpage_names = get_adminpage_name(array('script_name' => $site->script_name));
?>
<html>
	<head> 	
		<title><?php 
echo $site->sys_sona(array('sona' => 'Log', 'tyyp' => 'Admin'));
?>
</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/default_admin_page.css" media="screen">
		<script type="text/javascript" src="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
?>
/admin_menu.js"></script>
		<script type="text/javascript" src="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
?>
/yld.js"></script>
		if (sel_groups[i] == i){
			selected_groups = selected_groups+','+i;
		}
	}
	//alert(selected_groups);	
	document.getElementById('selectform_selgroups').value=selected_groups;
	document.forms['selectform'].submit();
}


//-->
</script>

</head>

<body class="popup_body" onload="make_breadcrumb('<?=$site->sys_sona(array(sona => "groups", tyyp=>"kasutaja"))?>' <?=$breadcrumb_focus_str?>);window.focus();">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
	<SCRIPT LANGUAGE="JavaScript">
	<!--
		function make_breadcrumb() {
			var ar = arguments;
			var html = '';
			for (i = 0; i < ar.length; i++) {
				if(i != 0) {
					html += '<img src="../styles/default/gfx/header/breadcrumb_arrow.gif" width="15" height="9">';
				}
				html +=  '<a href="#" class="scms_breadcrumb">' + ar[i] + '</a>';
			}
			var header_breadcrumb = document.getElementById("header_breadcrumb");
			var header_title = document.getElementById("header_title");
			if(header_title) header_title.innerHTML = ar[(ar.length-1)];
    if ($ext->validate_extension()) {
        sync_extensions();
        $synced = 1;
    }
    $zip = new archive();
    $zip->deltree($ext->tmp_location);
    @rmdir($ext->tmp_location);
}
if ($site->fdat['op'] == "upload") {
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head> 	
		<title><?php 
    echo $site->sys_sona(array('sona' => 'extension_upload', 'tyyp' => 'Admin'));
    ?>
</title>
		<meta http-equiv="Content-Type" content="text/html; charset=<?php 
    echo $site->encoding;
    ?>
">
		<link rel="stylesheet" href="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
    ?>
/default_admin_page.css" media="screen" />
		<script type="text/javascript" src="<?php 
    echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
    ?>
/yld.js"></script>
		<script type="text/javascript" src="<?php 
        <tr> 
		  <?php 
############ optimize database  ###########
?>
				<TD nowrap><?php 
if ($need_optimize && !$site->fdat['optimize']) {
    ?>
<a href="?optimize=1"><?php 
}
?>
<IMG SRC="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/gfx/icons/16x16/actions/exec.png" WIDTH="16" HEIGHT="16" BORDER="0" align=absmiddle><?php 
if ($need_optimize && !$site->fdat['optimize']) {
    echo '&nbsp;' . $site->sys_sona(array(sona => 'optimize database', tyyp => 'powertools'));
    ?>
</a><?php 
} else {
    echo '&nbsp;' . $site->sys_sona(array(sona => 'Database optimized', tyyp => 'powertools'));
}
?>
</TD>

		
		<?php 
###### wide middle cell ######
?>
		<td width="100%"></td>

		</tr>
	<input type=hidden name=op value="<?=$site->fdat['op']?>">
	<input type=hidden name=op2 value="">


<table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:200px">
  <tr> 
	<td valign="top" width="100%" class="scms_confirm_delete_cell" height="100%">
<?	
	############ # get extension templates
	$extension->templates_arr = $extension->get_templates();
	foreach($extension->templates_arr as $templ){
		$templ_arr[] = $templ['templ_fail'];
	}
	
	# show confirmation
	echo $site->sys_sona(array(sona => "kustuta", tyyp=>"editor"))." \"<b>".$site->fdat['name']."</b>\"? ";
	echo $site->sys_sona(array(sona => "are you sure?", tyyp=>"admin"));
	$allow_delete = 1;

	######## show extension info:

?>
	<br>
	<br><b><?=$extension->all['path']?></b>
	<?if(count($templ_arr)){?>
		<br><?=join(", ",$templ_arr)?>
	<?}?>

	</td>
  </tr>
  <tr align="right"> 
Exemplo n.º 18
0
<body>

<div id="mainContainer">

	<div class="toolbarArea">
		<form name="toolbar_form" id="toolbar_form" method="POST" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
				<table cellpadding="0" cellspacing="0" width="100%" align="right">
				<tr>
					<td>
	            		<ul class="s_Buttons_container" style="float: right;">
	            			<li><span><?php 
echo $site->sys_sona(array('sona' => 'Language', 'tyyp' => 'Admin'));
?>
: <select name="flt_keel" onchange="submit()" class="drop"><?php 
######################
# language dropdown
$sql = "SELECT nimi,keel_id FROM keel WHERE on_kasutusel = '1' ORDER BY nimi";
$sth = new SQL($sql);
$site->debug->msg($sth->debug->get_msgs());
while ($keel = $sth->fetch()) {
    print "\t<option value=\"{$keel['keel_id']}\" " . ($keel[keel_id] == $keel_id ? "selected" : "") . ">{$keel['nimi']}</option>";
}
?>
</select></span></li></ul>
					</td>
				</tr>
			</table>
			selected_groups = selected_groups+','+i;
		}
	}
	//alert(selected_groups);	
	document.getElementById('selectform_selgroups').value=selected_groups;
	document.forms['selectform'].submit();
}


//-->
</script>

</head>

<body class="popup_body" onload="make_breadcrumb('<?php 
echo $site->sys_sona(array(sona => "groups", tyyp => "kasutaja"));
?>
' <?php 
echo $breadcrumb_focus_str;
?>
);window.focus();">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
	<SCRIPT LANGUAGE="JavaScript">
	<!--
		function make_breadcrumb() {
			var ar = arguments;
			var html = '';
			for (i = 0; i < ar.length; i++) {
				if(i != 0) {
					html += '<img src="../styles/default/gfx/header/breadcrumb_arrow.gif" width="15" height="9">';
				}
var selected_file = <?php 
echo $selected_file_id;
?>
;
var file_page = 1;
var settings = <?php 
echo $json_encoder->encode($settings);
?>
;
var ajax_token = <?php 
echo create_form_token_json('filemanager');
?>
;
var translations = {
	search_files: '<?php 
echo $site->sys_sona(array('sona' => 'search_files', 'tyyp' => 'Files'));
?>
',
	upload_queue_limit: '<?php 
echo $site->sys_sona(array('sona' => 'upload_queue_limit', 'tyyp' => 'Files'));
?>
',
	upload_limit_size: '<?php 
echo $site->sys_sona(array('sona' => 'upload_limit_size', 'tyyp' => 'Files'));
?>
',
	file: '<?php 
echo $site->sys_sona(array('sona' => 'file', 'tyyp' => 'Files'));
?>
',
	files: '<?php 
Exemplo n.º 21
0
$root = new Alamlist(array('parent' => $trash_id, 'klass' => $classes, 'order' => $sort_by . ' ' . $sort_dir));
$untraveled = array();
//stack
$periferal = array();
//misc data for other table cells
while ($item = $root->next()) {
    $untraveled[] = array('level' => 0, 'object' => $item);
    $periferal[] = $item;
}
$untraveled = array_reverse($untraveled);
$adminpage_names = get_adminpage_name(array('script_name' => $site->script_name));
?>
<html>
	<head> 	
		<title><?php 
echo $site->sys_sona(array('sona' => 'recycle bin', 'tyyp' => 'Admin'));
?>
</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" href="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/default_admin_page.css" media="screen">
		<link rel="stylesheet" href="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/scms_dropdown.css" media="screen">
		<script type="text/javascript" src="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
?>
/admin_menu.js"></script>
if (!$site->user->allowed_adminpage()) {
    exit;
}
######### get adminpage name
$adminpage_names = get_adminpage_name(array("script_name" => $site->script_name));
$parent_pagename = $adminpage_names['parent_pagename'];
$pagename = $adminpage_names['pagename'];
#temporary:
error_reporting(7);
$site->fdat['profile_id'] = (int) $site->fdat['profile_id'];
#################
# GET profile INFO
if ($site->fdat['profile_id']) {
    $site->fdat['profile_id'] = (int) $site->fdat['profile_id'];
    $profile_def = $site->get_profile(array(id => $site->fdat['profile_id']));
    $breadcrumb_focus_str = ",'" . $site->sys_sona(array(sona => $profile_def['name'], tyyp => "custom")) . "'";
    # sanity check: kui ei leitud sellise nimega profiili, anda toimetajale veateade ja v�ljuda:
    if (!$profile_def['profile_id']) {
        if ($site->in_admin && $site->fdat['profile_id']) {
            print "<font color=red><b>Profile '" . $site->fdat['profile_id'] . "' not found!</b></font>";
        }
        exit;
    }
    ######### EXTERNAL TABLE ?
    if (substr($profile_def['source_table'], 0, 4) == 'ext_') {
        $external_table = $profile_def['source_table'];
    }
}
#################
# GET objekt INFO
if ($site->fdat['objekt_id']) {
Exemplo n.º 23
0
# get object permissions for current user
$site->debug->msg("EDIT: Liigutatava objekti " . $objekt->objekt_id . " õigused = " . $objekt->permission['mask']);
###########################
# ACCESS allowed/denied
# decide if accessing this page is allowed or not
# MOVE UP/DOWN: if current object has UPDATE permission => allow
if ($objekt->permission['U'] || $system_admin) {
    $access = 1;
} else {
    $access = 0;
}
####################
# access denied
if (!$access) {
    new Log(array('action' => 'update', 'objekt_id' => $objekt->objekt_id, 'type' => 'WARNING', 'message' => sprintf("access denied: attempt to move %s '%s' (ID = %s)", ucfirst(translate_en($objekt->all[klass])), $objekt->pealkiri(), $objekt->objekt_id)));
    print "<center><b><font class=\"txt\">" . $site->sys_sona(array(sona => "access denied", tyyp => "editor")) . "</font></b></center>";
    if ($site->user) {
        $site->user->debug->print_msg();
    }
    if ($site->guest) {
        $site->guest->debug->print_msg();
    }
    $site->debug->print_msg();
    ########### EXIT
    exit;
}
# / ACCESS allowed/denied
###########################
###########################
# GO ON with real work
# -------------------------------------
Exemplo n.º 24
0
<?
################################
# FUNCTION BAR
?>
<!-- Toolbar -->
<TR>
<TD class="scms_toolbar">

	<?######### FUNCTION BAR ############?>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
		  <?############ optimize database  ###########?>
				<TD nowrap><?if($need_optimize && !$site->fdat['optimize']){?><a href="?optimize=1"><?}?><IMG SRC="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/gfx/icons/16x16/actions/exec.png" WIDTH="16" HEIGHT="16" BORDER="0" align=absmiddle><?if($need_optimize && !$site->fdat['optimize']){ echo  '&nbsp;'.$site->sys_sona(array(sona => 'optimize database' , tyyp=>'powertools'))?></a><?} else { echo '&nbsp;'.$site->sys_sona(array(sona => 'Database optimized' , tyyp=>'powertools')); }?></TD>

		
		<?###### wide middle cell ######?>
		<td width="100%"></td>

		</tr>

      </table>
</TD>
</TR>

<?
# / FUNCTION BAR
################################
?>
Exemplo n.º 25
0
  <tr> 
	<td valign="top" width="100%" class="scms_confirm_delete_cell" height="100%">
<?
	# check if allowed to delete
	# 1. if exists any data row with that form, then don't allow to delete

	$data_count = 0;
	############ form content data
		$sql = $site->db->prepare("SELECT COUNT(*) FROM ".$form_def['source_table']." WHERE form_id=? ",$form_def['form_id']);
		$sth = new SQL($sql);
		$form_count = $sth->fetchsingle();
		$data_count += $form_count;

	if($data_count > 0) {
		# show error message
		echo "<font color=red>".$site->sys_sona(array(sona => "Permission denied", tyyp=>"editor"))."</font><br><br>";
		echo $site->sys_sona(array(sona => "Children count", tyyp=>"admin")).": <b>".$data_count."</b>";
	}
	# show confirmation
	else {
		echo $site->sys_sona(array(sona => "kustuta", tyyp=>"editor"))." \"<b>".$form_def['name']."</b>\"? ";
		echo $site->sys_sona(array(sona => "are you sure?", tyyp=>"admin"));
		$allow_delete = 1;
	}
?>
	</td>
  </tr>
  <tr align="right"> 
    <td valign="top" colspan=2 > 
		<?if($allow_delete){?>
            <input type="button" value="<?=$site->sys_sona(array(sona => "kustuta", tyyp=>"editor")) ?>" onclick="javascript:frmEdit.op2.value='deleteconfirmed';frmEdit.submit();">
}
$error = '';
if ($site->fdat['action'] == 'save' && $site->fdat['op'] == 'new' && $sst_id && $site->fdat['sys_word']) {
    if ($allowed_edit) {
        $at_least_one_translation = false;
        foreach ($site->fdat['translation'] as $translation) {
            if ($translation) {
                $at_least_one_translation = true;
                break;
            }
        }
        if ($at_least_one_translation) {
            $sql = $site->db->prepare('select sys_sona from sys_sonad where sys_sona = ? and sst_id = ? limit 1', $site->fdat['sys_word'], $sst_id);
            $result = new SQL($sql);
            if ($result->rows) {
                $error = $site->sys_sona(array('sona' => 'glossary_translation_exists', 'tyyp' => 'admin'));
            } else {
                $sql = "select distinct keel_id, nimi from sys_sonad left join keel on keel = keel_id";
                $sth = new SQL($sql);
                ################
                # tsükkel üle kõigi keelte
                while ($keel = $sth->fetch()) {
                    # kontrolli, kas süssõna leidub
                    $sql = $site->db->prepare("SELECT count(*) FROM sys_sonad WHERE sys_sona = ? and keel=? and sst_id=?", $site->fdat['sys_word'], $keel[keel_id], $sst_id);
                    $sth_s = new SQL($sql);
                    $exists = $sth_s->fetchsingle();
                    # kui ei leidu:
                    if (!$exists) {
                        # lisa ainult siis kui süssõna pole tühi
                        # sys_sonad
                        $sql = $site->db->prepare("INSERT INTO sys_sonad (sys_sona, keel, sona, origin_sona, sst_id) values(?,?,?,?,?)", $site->fdat['sys_word'], $keel[keel_id], $site->fdat['translation'][$keel['keel_id']], $site->fdat['translation_in_cms'][$keel['keel_id']], $sst_id);
	<!-- Scrollable area -->
	<div id=listing class="scms_middle_div">

	<!-- Adding-more-space table -->
	<table width="100%"  border="0" cellspacing="3" cellpadding="0" class="scms_table">
	<tr>
	<td>
	<br />
		<!-- Content table with border -->
		  <table width="100%"  border="0" cellspacing="3" cellpadding="0" class="scms_borderbox">
			<tr> 
			  <td colspan="2"> 
				<div style="position:relative"> 
				  <div class="scms_borderbox_label"><?php 
    echo $site->sys_sona(array(sona => "Glossary import", tyyp => "admin"));
    echo is_numeric($site->fdat['flt_keel']) ? ' : ' . $page_lang_name : '';
    ?>
</div>
				</div>
			  </td>
			</tr>
			<tr> 
			  <td colspan=2 class="scms_table">
	<?php 
    ########################
    # STEP 2: SAVE IMPORT
    if ($site->fdat['op2'] == 'salvesta') {
        verify_form_token();
        import2glossary();
    } else {
    }
    $definitions = array();
    $sql = 'select * from config_images';
    $result = new SQL($sql);
    while ($row = $result->fetch('ASSOC')) {
        $definitions[$row['definition_id']] = $row;
    }
}
// / process image definitions form
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head> 	
		<title><?php 
echo $site->sys_sona(array('sona' => 'Image manipulation', 'tyyp' => 'Admin'));
?>
</title>
		<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $site->encoding;
?>
">
		<link rel="stylesheet" href="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['styles_path'];
?>
/default_admin_page.css" media="screen">
		<script type="text/javascript" src="<?php 
echo $site->CONF['wwwroot'] . $site->CONF['js_path'];
?>
/ie_position_fix.js"></script>
		<script type="text/javascript">
 * 
 * @package		SaurusCMS
 * @copyright	2000-2010 Saurused Ltd (http://www.saurus.info/)
 * @license		Mozilla Public License 1.1 (http://www.opensource.org/licenses/mozilla1.1.php)
 * 
 */
global $site;
global $class_path;
if (!isset($class_path)) {
    $class_path = "../classes/";
}
include_once $class_path . "port.inc.php";
$site = new Site(array(on_debug => 1, on_admin_keel => 1));
########### SUPERUSER CHECK:
if (!$site->user->is_superuser) {
    echo $site->sys_sona(array(sona => "Permission denied", tyyp => "editor"));
    exit;
}
$objekti_arv = 0;
########### TYPES to repair
$types_arr = array();
if (isset($site->fdat['type'])) {
    $types_arr = $site->fdat['type'];
} else {
    $types_arr = array('objects', 'permissions', 'users', 'mailinglists', 'sso', 'polls', 'favorites', 'systemwords', 'files');
}
#printr($types_arr);
#####################
# HTML
?>
$include_once = true;
include $class_path . "port.inc.php";
$site = new Site(array(on_debug => 0));
?>
function checkForumFields(variant){
// variant=1 => check message body, autor, headline
// variant=2 => check message body, headline

	if (variant==1){autor = document.forumFrm.nimi.value;}
	headline = document.forumFrm.pealkiri.value;
	message = document.forumFrm.text.value;

	if (variant==1){
		if (autor.length < 2){
			alert('<?php 
echo trim($site->sys_sona(array(sona => "Forum alert: Enter your name!", tyyp => "kujundus")));
?>
'); return false;
		}
	}
	if (headline.length < 2){
		alert('<?php 
echo trim($site->sys_sona(array(sona => "Forum alert: Please fill in the subject!", tyyp => "kujundus")));
?>
'); return false;
	} else if (message.length < 2){
		alert('<?php 
echo trim($site->sys_sona(array(sona => "Forum alert: Please fill in the message body!", tyyp => "kujundus")));
?>
'); return false;
	} else {