Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
cf65af16
Commit
cf65af16
authored
Dec 28, 2017
by
Alain Takoudjou
Committed by
Alain Takoudjou
Oct 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_monitoring] fix problem of changing password when current password is broken
parent
a560403d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
17 deletions
+64
-17
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_opml_edit_js.js
...eb_page_module/gadget_officejs_monitoring_opml_edit_js.js
+51
-10
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_opml_edit_js.xml
...b_page_module/gadget_officejs_monitoring_opml_edit_js.xml
+2
-2
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.js
...TemplateItem/web_page_module/monitoring_jio_storage_js.js
+9
-3
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.xml
...emplateItem/web_page_module/monitoring_jio_storage_js.xml
+2
-2
No files found.
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_opml_edit_js.js
View file @
cf65af16
/*global window, rJS, RSVP, btoa, XMLHttpRequest, Handlebars */
/*global window, rJS, RSVP, btoa, XMLHttpRequest, Handlebars
, jIO
*/
/*jslint nomen: true, indent: 2, maxerr: 3*/
/*jslint nomen: true, indent: 2, maxerr: 3*/
(
function
(
window
,
rJS
,
RSVP
,
btoa
,
XMLHttpRequest
,
Handlebars
)
{
(
function
(
window
,
rJS
,
RSVP
,
btoa
,
XMLHttpRequest
,
Handlebars
,
jIO
)
{
"
use strict
"
;
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
),
var
gadget_klass
=
rJS
(
window
),
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
});
});
}
}
function
checkCredential
(
url
,
title
,
hash
)
{
function
checkCredential
(
url
,
title
,
hash
,
new_hash
)
{
// Verify if login and password are correct for this URL
// Verify if login and password are correct for this URL
if
(
url
===
undefined
)
{
if
(
url
===
undefined
)
{
return
{
status
:
'
OK
'
};
return
{
status
:
'
OK
'
};
...
@@ -122,6 +122,17 @@
...
@@ -122,6 +122,17 @@
msg
:
error
.
msg
+
'
(
'
+
url
+
'
)
'
,
msg
:
error
.
msg
+
'
(
'
+
url
+
'
)
'
,
title
:
title
title
:
title
};
};
if
(
new_hash
!==
undefined
)
{
// saved password is not valid
// check if inputted password is valid
return
testUrl
(
url
,
new_hash
)
.
then
(
function
()
{
ko_msg
.
hash
=
new_hash
;
return
ko_msg
;
},
function
()
{
return
ko_msg
;
});
}
return
ko_msg
;
return
ko_msg
;
});
});
}
}
...
@@ -152,7 +163,8 @@
...
@@ -152,7 +163,8 @@
attachment_id
:
'
enclosure
'
,
attachment_id
:
'
enclosure
'
,
parser
:
'
opml
'
,
parser
:
'
opml
'
,
sub_storage
:
{
sub_storage
:
{
type
:
"
http
"
type
:
"
http
"
,
timeout
:
25000
// timeout after 25 seconds
}
}
}
}
})
})
...
@@ -162,25 +174,40 @@
...
@@ -162,25 +174,40 @@
});
});
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
var
message_text
,
code
;
if
(
error
instanceof
jIO
.
util
.
jIOError
)
{
message_text
=
error
.
message
;
code
=
error
.
status_code
;
}
else
{
code
=
error
.
target
.
status
;
message_text
=
error
.
target
.
responseType
===
"
text
"
?
error
.
target
.
statusText
:
""
;
}
gadget
.
state
.
message
gadget
.
state
.
message
.
innerHTML
=
notify_msg_template
({
.
innerHTML
=
notify_msg_template
({
status
:
'
error
'
,
status
:
'
error
'
,
message
:
error
.
target
.
status
+
message
:
code
+
"
: Failed to access OPML URL.
"
+
"
: Failed to access OPML URL.
"
+
error
.
message
message_text
});
});
return
{
data
:
{
total_rows
:
0
}};
return
{
data
:
{
total_rows
:
0
}};
})
})
.
push
(
function
(
opml_result
)
{
.
push
(
function
(
opml_result
)
{
var
i
,
var
i
,
check_list
=
[
true
];
check_list
=
[
true
],
new_login
;
if
(
opml_result
.
data
.
total_rows
>
0
)
{
if
(
opml_result
.
data
.
total_rows
>
0
)
{
opml_dict
.
title
=
opml_result
.
data
.
rows
[
0
].
value
.
title
;
opml_dict
.
title
=
opml_result
.
data
.
rows
[
0
].
value
.
title
;
if
(
doc
.
new_password
)
{
new_login
=
btoa
(
doc
.
username
+
'
:
'
+
doc
.
new_password
);
}
for
(
i
=
1
;
i
<
opml_result
.
data
.
total_rows
;
i
+=
1
)
{
for
(
i
=
1
;
i
<
opml_result
.
data
.
total_rows
;
i
+=
1
)
{
if
(
opml_result
.
data
.
rows
[
i
].
value
.
url
!==
undefined
)
{
if
(
opml_result
.
data
.
rows
[
i
].
value
.
url
!==
undefined
)
{
check_list
.
push
(
checkCredential
(
check_list
.
push
(
checkCredential
(
opml_result
.
data
.
rows
[
i
].
value
.
url
,
opml_result
.
data
.
rows
[
i
].
value
.
url
,
opml_result
.
data
.
rows
[
i
].
value
.
title
,
opml_result
.
data
.
rows
[
i
].
value
.
title
,
opml_dict
.
basic_login
opml_dict
.
basic_login
,
new_login
));
));
update_password_list
.
push
({
update_password_list
.
push
({
base_url
:
opml_result
.
data
.
rows
[
i
].
value
.
url
,
base_url
:
opml_result
.
data
.
rows
[
i
].
value
.
url
,
...
@@ -195,14 +222,28 @@
...
@@ -195,14 +222,28 @@
})
})
.
push
(
function
(
status_list
)
{
.
push
(
function
(
status_list
)
{
var
i
,
var
i
,
error_msg
=
''
;
error_msg
=
''
,
used_new_passwd_count
=
0
;
// in case the current password in opml is wrong and new
// password provided is OK, we set it as the current password in opml.
for
(
i
=
1
;
i
<
status_list
.
length
;
i
+=
1
)
{
for
(
i
=
1
;
i
<
status_list
.
length
;
i
+=
1
)
{
if
(
status_list
[
i
].
status
!==
'
OK
'
)
{
if
(
status_list
[
i
].
status
!==
'
OK
'
)
{
if
(
status_list
[
i
].
hash
!==
undefined
)
{
used_new_passwd_count
+=
1
;
}
error_msg
+=
'
Login/password invalid for instance:
'
+
error_msg
+=
'
Login/password invalid for instance:
'
+
status_list
[
i
].
title
+
'
.
'
+
status_list
[
i
].
title
+
'
.
'
+
status_list
[
i
].
msg
+
'
\n
'
;
status_list
[
i
].
msg
+
'
\n
'
;
}
}
}
}
if
(
used_new_passwd_count
>
0
&&
used_new_passwd_count
===
(
status_list
.
length
-
1
))
{
// all backends password are OK, we only update our password
opml_dict
.
password
=
doc
.
new_password
;
doc
.
new_password
=
''
;
opml_dict
.
basic_login
=
status_list
[
1
].
hash
;
return
true
;
}
if
(
error_msg
!==
''
)
{
if
(
error_msg
!==
''
)
{
gadget
.
state
.
message
gadget
.
state
.
message
.
innerHTML
=
notify_msg_template
({
.
innerHTML
=
notify_msg_template
({
...
@@ -352,4 +393,4 @@
...
@@ -352,4 +393,4 @@
return
saveOPML
(
this
,
form_doc
,
verify_password
);
return
saveOPML
(
this
,
form_doc
,
verify_password
);
});
});
}(
window
,
rJS
,
RSVP
,
btoa
,
XMLHttpRequest
,
Handlebars
));
}(
window
,
rJS
,
RSVP
,
btoa
,
XMLHttpRequest
,
Handlebars
,
jIO
));
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_opml_edit_js.xml
View file @
cf65af16
...
@@ -242,7 +242,7 @@
...
@@ -242,7 +242,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
3.29541.62889.7577
</string>
</value>
<value>
<string>
96
4.28658.19106.46779
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
151
0680916.21
</float>
<float>
151
4476756.65
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.js
View file @
cf65af16
...
@@ -38,10 +38,16 @@
...
@@ -38,10 +38,16 @@
}
}
function
createStorage
(
context
,
storage_spec
,
key
)
{
function
createStorage
(
context
,
storage_spec
,
key
)
{
if
(
!
context
.
_remote_storage_dict
.
hasOwnProperty
(
key
))
{
var
signature
;
context
.
_remote_storage_dict
[
key
]
=
jIO
.
createJIO
(
storage_spec
);
signature
=
generateHash
(
JSON
.
stringify
(
storage_spec
));
if
(
!
context
.
_remote_storage_dict
.
hasOwnProperty
(
key
)
||
signature
!==
context
.
_remote_storage_dict
[
key
].
signature
)
{
context
.
_remote_storage_dict
[
key
]
=
{
storage
:
jIO
.
createJIO
(
storage_spec
),
signature
:
signature
};
}
}
return
context
.
_remote_storage_dict
[
key
];
return
context
.
_remote_storage_dict
[
key
]
.
storage
;
}
}
/**
/**
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.xml
View file @
cf65af16
...
@@ -239,7 +239,7 @@
...
@@ -239,7 +239,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
6864.64042.3420
1
</string>
</value>
<value>
<string>
964.
7018.29631.5055
1
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -257,7 +257,7 @@
...
@@ -257,7 +257,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
151
3173747.08
</float>
<float>
151
4476144.01
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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