Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
da8a5959
Commit
da8a5959
authored
12 years ago
by
Yves Christian KPAKPO
Browse files
Options
Downloads
Patches
Plain Diff
Fix: notes table name in query (use var name not session var name)
parent
74b93fd2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notes/trunk/class/class_modules_tools.php
+8
-8
8 additions, 8 deletions
notes/trunk/class/class_modules_tools.php
with
8 additions
and
8 deletions
notes/trunk/class/class_modules_tools.php
+
8
−
8
View file @
da8a5959
...
@@ -173,7 +173,7 @@ class notes extends dbquery
...
@@ -173,7 +173,7 @@ class notes extends dbquery
public
function
getNotes
(
$noteId
,
$userId
,
$userPrimaryEntity
)
public
function
getNotes
(
$noteId
,
$userId
,
$userPrimaryEntity
)
{
{
$query
=
"select id from notes where id in ("
$query
=
"select id from notes where id in ("
.
"select note_id from
note_entities
where (item_id = '"
.
"select note_id from
"
.
NOTE_ENTITIES_TABLE
.
"
where (item_id = '"
.
$userPrimaryEntity
.
"' and note_id = "
.
$noteId
.
"))"
.
$userPrimaryEntity
.
"' and note_id = "
.
$noteId
.
"))"
.
"or (id = "
.
$noteId
.
" and user_id = '"
.
$userId
.
"')"
;
.
"or (id = "
.
$noteId
.
" and user_id = '"
.
$userId
.
"')"
;
$db
=
new
dbquery
();
$db
=
new
dbquery
();
...
@@ -184,7 +184,7 @@ class notes extends dbquery
...
@@ -184,7 +184,7 @@ class notes extends dbquery
return
true
;
return
true
;
}
else
{
}
else
{
// test if public
// test if public
$query
=
"select note_id from
note_entities
where note_id = "
.
$noteId
;
$query
=
"select note_id from
"
.
NOTE_ENTITIES_TABLE
.
"
where note_id = "
.
$noteId
;
$db
->
query
(
$query
);
$db
->
query
(
$query
);
if
(
$db
->
nb_result
()
==
0
)
{
if
(
$db
->
nb_result
()
==
0
)
{
return
true
;
return
true
;
...
@@ -201,7 +201,7 @@ class notes extends dbquery
...
@@ -201,7 +201,7 @@ class notes extends dbquery
$db
=
new
dbquery
();
$db
=
new
dbquery
();
$db
->
connect
();
$db
->
connect
();
$dbId
->
query
(
"select id, identifier, user_id, date_note, note_text from "
$dbId
->
query
(
"select id, identifier, user_id, date_note, note_text from "
.
$_SESSION
[
'tablename'
][
'not_notes'
]
.
NOTES_TABLE
.
" where identifier = "
.
$id
.
" where identifier = "
.
$id
.
" and coll_id ='"
.
" and coll_id ='"
.
$coll_id
.
"' order by date_note desc"
);
.
$coll_id
.
"' order by date_note desc"
);
...
@@ -210,7 +210,7 @@ class notes extends dbquery
...
@@ -210,7 +210,7 @@ class notes extends dbquery
{
{
$dbNotesEntities
=
new
dbquery
();
$dbNotesEntities
=
new
dbquery
();
$dbNotesEntities
->
connect
();
$dbNotesEntities
->
connect
();
$query
=
"select id from
note_entities
where "
$query
=
"select id from
"
.
NOTE_ENTITIES_TABLE
.
"
where "
.
"note_id = "
.
$res
->
id
;
.
"note_id = "
.
$res
->
id
;
$dbNotesEntities
->
query
(
$query
);
$dbNotesEntities
->
query
(
$query
);
...
@@ -220,7 +220,7 @@ class notes extends dbquery
...
@@ -220,7 +220,7 @@ class notes extends dbquery
else
else
{
{
$db
->
query
(
"select id from notes where id in ("
$db
->
query
(
"select id from notes where id in ("
.
"select note_id from
note_entities
where (item_id = '"
.
"select note_id from
"
.
NOTE_ENTITIES_TABLE
.
"
where (item_id = '"
.
$_SESSION
[
'user'
][
'primaryentity'
][
'id'
]
.
"' and note_id = "
.
$res
->
id
.
"))"
.
$_SESSION
[
'user'
][
'primaryentity'
][
'id'
]
.
"' and note_id = "
.
$res
->
id
.
"))"
.
"or (id = "
.
$res
->
id
.
" and user_id = '"
.
$_SESSION
[
'user'
][
'UserId'
]
.
"')"
);
.
"or (id = "
.
$res
->
id
.
" and user_id = '"
.
$_SESSION
[
'user'
][
'UserId'
]
.
"')"
);
...
@@ -240,7 +240,7 @@ class notes extends dbquery
...
@@ -240,7 +240,7 @@ class notes extends dbquery
$db
=
new
dbquery
();
$db
=
new
dbquery
();
$db
->
connect
();
$db
->
connect
();
$dbId
->
query
(
"select id, identifier, user_id, date_note, note_text from "
$dbId
->
query
(
"select id, identifier, user_id, date_note, note_text from "
.
$_SESSION
[
'tablename'
][
'not_notes'
]
.
NOTES_TABLE
.
" where identifier = "
.
$id
.
" where identifier = "
.
$id
.
" and coll_id ='"
.
" and coll_id ='"
.
$coll_id
.
"' order by date_note desc"
);
.
$coll_id
.
"' order by date_note desc"
);
...
@@ -249,7 +249,7 @@ class notes extends dbquery
...
@@ -249,7 +249,7 @@ class notes extends dbquery
{
{
$dbNotesEntities
=
new
dbquery
();
$dbNotesEntities
=
new
dbquery
();
$dbNotesEntities
->
connect
();
$dbNotesEntities
->
connect
();
$query
=
"select id from
note_entities
where "
$query
=
"select id from
"
.
NOTE_ENTITIES_TABLE
.
"
where "
.
"note_id = "
.
$res
->
id
;
.
"note_id = "
.
$res
->
id
;
$dbNotesEntities
->
query
(
$query
);
$dbNotesEntities
->
query
(
$query
);
...
@@ -264,7 +264,7 @@ class notes extends dbquery
...
@@ -264,7 +264,7 @@ class notes extends dbquery
);
);
}
else
{
}
else
{
$db
->
query
(
"select id from notes where id in ("
$db
->
query
(
"select id from notes where id in ("
.
"select note_id from
note_entities
where (item_id = '"
.
"select note_id from
"
.
NOTE_ENTITIES_TABLE
.
"
where (item_id = '"
.
$_SESSION
[
'user'
][
'primaryentity'
][
'id'
]
.
"' and note_id = "
.
$res
->
id
.
"))"
.
$_SESSION
[
'user'
][
'primaryentity'
][
'id'
]
.
"' and note_id = "
.
$res
->
id
.
"))"
.
"or (id = "
.
$res
->
id
.
" and user_id = '"
.
$_SESSION
[
'user'
][
'UserId'
]
.
"')"
);
.
"or (id = "
.
$res
->
id
.
" and user_id = '"
.
$_SESSION
[
'user'
][
'UserId'
]
.
"')"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment