* @param string $string - string to check against the database
 * @return bool True or False if two params match
 * @version 1.0
 * @author Patrick Lockley
 */
function template_share_status($string)
{
    global $row_access;
    if ($row_access['access_to_whom'] == $string) {
        return true;
    } else {
        if (strcmp(substr($row_access['access_to_whom'], 0, 5), $string) == 0) {
            return true;
        } else {
            return false;
        }
    }
}
$database_connect_id = database_connect("Access template database connect success", "Access template database connect failed");
/*
 * only creator can set access
 */
if (is_numeric($_POST['template_id'])) {
    if (has_rights_to_this_template($_POST['template_id'], $_SESSION['toolkits_logon_id']) || is_user_admin()) {
        access_display($xerte_toolkits_site, false);
    } else {
        access_display_fail();
    }
} else {
    echo "<p>" . PROPERTIES_LIBRARY_ACCESS_FAIL . "</p>";
}
 * @return bool True or False if two params match
 * @version 1.0
 * @author Patrick Lockley
 */
function template_share_status($string)
{
    if ($_POST['access'] == $string) {
        return true;
    } else {
        if (strpos($string, "other-" == 0)) {
            return true;
        } else {
            return false;
        }
    }
}
$database_id = database_connect("Access change database connect success", "Access change database connect failed");
/*
 * Update the database setting
 */
if (isset($_POST['server_string'])) {
    $query = "update " . $xerte_toolkits_site->database_table_prefix . "templatedetails SET access_to_whom =\"" . mysql_real_escape_string($_POST['access']) . "-" . mysql_real_escape_string($_POST['server_string']) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\"";
} else {
    $query = "update " . $xerte_toolkits_site->database_table_prefix . "templatedetails SET access_to_whom =\"" . mysql_real_escape_string($_POST['access']) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\"";
}
if (mysql_query($query)) {
    access_display($xerte_toolkits_site, true);
} else {
    access_display_fail();
}
mysql_close($database_id);