Removed "service class" functionality
This commit is contained in:
parent
1b53b8cae9
commit
0695fa699c
12 changed files with 6 additions and 224 deletions
|
@ -832,24 +832,6 @@ function photos_post(App $a) {
|
|||
|
||||
$imagedata = @file_get_contents($src);
|
||||
|
||||
|
||||
$limit = service_class_fetch($a->data['user']['uid'], 'photo_upload_limit');
|
||||
|
||||
if ($limit) {
|
||||
$r = q("SELECT SUM(OCTET_LENGTH(`data`)) AS `total` FROM `photo` WHERE `uid` = %d AND `scale` = 0 AND `album` != 'Contact Photos'",
|
||||
intval($a->data['user']['uid'])
|
||||
);
|
||||
$size = $r[0]['total'];
|
||||
|
||||
if (($size + strlen($imagedata)) > $limit) {
|
||||
notice( upgrade_message() . EOL );
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
call_hooks('photo_post_end',$foo);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
||||
$ph = new Photo($imagedata, $type);
|
||||
|
||||
if (! $ph->is_valid()) {
|
||||
|
@ -1145,15 +1127,6 @@ function photos_content(App $a) {
|
|||
));
|
||||
|
||||
$usage_message = '';
|
||||
$limit = service_class_fetch($a->data['user']['uid'], 'photo_upload_limit');
|
||||
if ($limit !== false) {
|
||||
|
||||
$r = q("SELECT SUM(`datasize`) AS `total` FROM `photo` WHERE `uid` = %d AND `scale` = 0 AND `album` != 'Contact Photos'",
|
||||
intval($a->data['user']['uid'])
|
||||
);
|
||||
$usage_message = sprintf(t("You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."), $r[0]['total'] / 1024000, $limit / 1024000 );
|
||||
}
|
||||
|
||||
|
||||
// Private/public post links for the non-JS ACL form
|
||||
$private_post = 1;
|
||||
|
|
|
@ -874,12 +874,7 @@ function settings_content(App $a) {
|
|||
|
||||
$tpl = get_markup_template("settings_connectors.tpl");
|
||||
|
||||
if (! service_class_allows(local_user(),'email_connect')) {
|
||||
$mail_disabled_message = upgrade_bool_message();
|
||||
} else {
|
||||
$mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
|
||||
}
|
||||
|
||||
$mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
|
||||
|
||||
$o .= replace_macros($tpl, array(
|
||||
'$form_security_token' => get_form_security_token("settings_connectors"),
|
||||
|
|
|
@ -114,26 +114,6 @@ function wall_attach_post(App $a) {
|
|||
killme();
|
||||
}
|
||||
|
||||
$limit = service_class_fetch($page_owner_uid,'attach_upload_limit');
|
||||
|
||||
if ($limit) {
|
||||
$r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
$size = $r[0]['total'];
|
||||
|
||||
if (($size + strlen($imagedata)) > $limit) {
|
||||
$msg = upgrade_message(true);
|
||||
if ($r_json) {
|
||||
echo json_encode(array('error'=>$msg));
|
||||
} else {
|
||||
echo $msg. EOL ;
|
||||
}
|
||||
@unlink($src);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
||||
$filedata = @file_get_contents($src);
|
||||
$mimetype = z_mime_content_type($filename);
|
||||
$hash = get_guid(64);
|
||||
|
|
|
@ -189,29 +189,6 @@ function wall_upload_post(App $a, $desktopmode = true) {
|
|||
killme();
|
||||
}
|
||||
|
||||
|
||||
$limit = service_class_fetch($page_owner_uid, 'photo_upload_limit');
|
||||
|
||||
if ($limit) {
|
||||
$r = q("SELECT SUM(OCTET_LENGTH(`data`)) AS `total` FROM `photo`
|
||||
WHERE `uid` = %d AND `scale` = 0
|
||||
AND `album` != 'Contact Photos' ",
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
$size = $r[0]['total'];
|
||||
|
||||
if (($size + strlen($imagedata)) > $limit) {
|
||||
$msg = upgrade_message(true);
|
||||
if ($r_json) {
|
||||
echo json_encode(array('error'=>$msg));
|
||||
} else {
|
||||
echo $msg. EOL;
|
||||
}
|
||||
@unlink($src);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
||||
$imagedata = @file_get_contents($src);
|
||||
$ph = new Photo($imagedata, $filetype);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue