Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
515c80e6
Commit
515c80e6
authored
Jul 08, 2004
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed the bug setting the content_length
parent
69286cdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
upload-2.tcl
www/users/portrait/upload-2.tcl
+29
-21
No files found.
www/users/portrait/upload-2.tcl
View file @
515c80e6
...
@@ -142,10 +142,18 @@ values
...
@@ -142,10 +142,18 @@ values
# let's figure out if this person has a portrait yet
# let's figure out if this person has a portrait yet
if
{
!
[
db_0or1row get_item_id
"select object_id_two as item_id
set
user_has_portrait_p
[
db_0or1row get_item_id
"
from acs_rels
select
where object_id_one = :user_id
object_id_two as item_id
and rel_type = 'user_portrait_rel'"
]
}
{
from
acs_rels
where
object_id_one = :user_id
and rel_type = 'user_portrait_rel'
"
]
if
{
!$user_has_portrait_p
}
{
# The user doesn't have a portrait relation yet
# The user doesn't have a portrait relation yet
db_transaction
{
db_transaction
{
set item_id
[
db_exec_plsql create_item
$create
_item
]
set item_id
[
db_exec_plsql create_item
$create
_item
]
...
@@ -155,35 +163,35 @@ and rel_type = 'user_portrait_rel'"] } {
...
@@ -155,35 +163,35 @@ and rel_type = 'user_portrait_rel'"] } {
db_dml upload_image_info
$upload
_image_info
db_dml upload_image_info
$upload
_image_info
}
}
}
else
{
}
#already has a portrait, so all we have to do is to make a new revision for it
#already has a portrait, so all we have to do is to make a new revision for it
#Let's check if a current revision exists:
#Let's check if a current revision exists:
if
{
!
[
db_0or1row get_revision_id
"select live_revision as revision_id
if
{
!
[
db_0or1row get_revision_id
"select live_revision as revision_id
from cr_items
from cr_items
where item_id = :item_id"
]
||
[
empty_string_p
$revision
_id
]}
{
where item_id = :item_id"
]
||
[
empty_string_p
$revision
_id
]}
{
# It's an insert rather than an update
# It's an insert rather than an update
db_transaction
{
db_transaction
{
set revision_id
[
db_exec_plsql create_revision
$create
_revision
]
set revision_id
[
db_exec_plsql create_revision
$create
_revision
]
db_dml update_photo
$update
_photo -blob_files
[
list
$tmp
_filename
]
db_dml update_photo
$update
_photo -blob_files
[
list
$tmp
_filename
]
db_dml upload_image_info
$upload
_image_info
db_dml upload_image_info
$upload
_image_info
}
}
}
else
{
}
else
{
# it's merely an update
# it's merely an update
db_transaction
{
db_transaction
{
db_dml update_photo
$update
_photo -blob_files
[
list
$tmp
_filename
]
db_dml update_photo
$update
_photo -blob_files
[
list
$tmp
_filename
]
db_dml update_image_info
"
db_dml update_image_info
"
update images
update images
set width = :original_width, height = :original_height
set width = :original_width, height = :original_height
where image_id = :revision_id"
where image_id = :revision_id"
db_dml update_photo_info
"
db_dml update_photo_info
"
update cr_revisions
update cr_revisions
set description = :portrait_comment,
set description = :portrait_comment,
publish_date = sysdate,
publish_date = sysdate,
mime_type = :guessed_file_type,
mime_type = :guessed_file_type,
title = :title
title = :title
where revision_id = :revision_id"
where revision_id = :revision_id"
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment