Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

After Beta4 #19

Merged
merged 17 commits into from

2 participants

@lslezak
Owner

A group of fixes which were postponed after Beta4 release.

lslezak added some commits
@lslezak lslezak software - fixed rendering permission error in patch summary
do not render flash[:error] in ajax summary
638b72d
@lslezak lslezak roles/index.html.erb - added FIXME note bfe2683
@lslezak lslezak fixed initializing session secret (for signing cookies) at the first …
…start (bnc#792632)
5957f69
@lslezak lslezak roles/index.html.erb - fixed "don't put space before argument parenth…
…eses" warning
63bcb98
@lslezak lslezak services - fixed JS loading in IE9 (console is not available by defau…
…lt) (bnc#783873)
c22a3cf
@lslezak lslezak users - fixed check for existing user when there is no user defined yet
in JS "".split(",") => [""] which breaks the check
8f508a8
@lslezak lslezak users - small JS refactoring, added FIXME notes e3073d4
@lslezak lslezak users - added FIXME notes 99b4014
@lslezak lslezak webyast-users.js - fixed missing semicolons e3a24fd
@lslezak lslezak status - fixed displaying graphs in IE9 (bnc#792632) a2222b4
@lslezak lslezak Merge branch 'master' into after_beta4
Conflicts:
	plugins/users/app/assets/javascripts/webyast-users.js
b0c4bfa
@lslezak lslezak activedirectory - fixed generic save error handler
- the global on/off checkbox also enables/disables account settings input fields
4dc8515
@lslezak lslezak software - display a warning when software management is locked by an…
…other application, do not crash (bnc#793602)
a2c1c43
@lslezak lslezak software - added before filters for cached actions
to properly drop the cache and check access permissions
77ed448
@lslezak lslezak software - display patch messages better (bnc#790748) e08bd44
@lslezak lslezak software - fixed JS rendering at new repository page (bnc#794049)
allow changing properties of the new repository
405df4f
@lslezak lslezak Merge branch 'master' into after_beta4
Conflicts:
	plugins/services/package/rubygem-webyast-services.changes
9b83709
@vmoravec vmoravec was assigned
@vmoravec vmoravec commented on the diff
plugins/software/app/controllers/patches_controller.rb
((6 lines not shown))
cached_mtime = Rails.cache.fetch("webyast_patch_mtime")
current_mtime = Patch.mtime
+ Rails.logger.info "cached_mtime: #{cached_mtime.inspect}, current_mtime: #{current_mtime.inspect}"
@vmoravec Owner

The log message is perhaps too generic, I mean there is the 'patch' word missing which would describe what is it about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@vmoravec vmoravec commented on the diff
plugins/software/app/controllers/patches_controller.rb
@@ -46,6 +49,16 @@ def cache_check
end
end
+ def perm_check
+ authorize! :read, Patch
+ end
+
+ def perm_check_summary
+ if cannot? :read, Patch
+ render :text => _("Status not available (no permissions)")
@vmoravec Owner

Is an explicit return not required after the render call? After the before_filter has been applied, it will go on to execute the show_summary method which is not what we want..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@vmoravec
Owner

I'm done with reviewing here.

@lslezak lslezak merged commit 7a2714a into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 4, 2012
  1. @lslezak

    software - fixed rendering permission error in patch summary

    lslezak authored
    do not render flash[:error] in ajax summary
  2. @lslezak
Commits on Dec 5, 2012
  1. @lslezak
  2. @lslezak
Commits on Dec 6, 2012
  1. @lslezak
  2. @lslezak

    users - fixed check for existing user when there is no user defined yet

    lslezak authored
    in JS "".split(",") => [""] which breaks the check
  3. @lslezak
  4. @lslezak

    users - added FIXME notes

    lslezak authored
  5. @lslezak
  6. @lslezak
Commits on Dec 10, 2012
  1. @lslezak

    Merge branch 'master' into after_beta4

    lslezak authored
    Conflicts:
    	plugins/users/app/assets/javascripts/webyast-users.js
  2. @lslezak

    activedirectory - fixed generic save error handler

    lslezak authored
    - the global on/off checkbox also enables/disables account settings input fields
  3. @lslezak

    software - display a warning when software management is locked by an…

    lslezak authored
    …other application, do not crash (bnc#793602)
  4. @lslezak

    software - added before filters for cached actions

    lslezak authored
    to properly drop the cache and check access permissions
  5. @lslezak
Commits on Dec 12, 2012
  1. @lslezak

    software - fixed JS rendering at new repository page (bnc#794049)

    lslezak authored
    allow changing properties of the new repository
  2. @lslezak

    Merge branch 'master' into after_beta4

    lslezak authored
    Conflicts:
    	plugins/services/package/rubygem-webyast-services.changes
This page is out of date. Refresh to see the latest.
Showing with 150 additions and 69 deletions.
  1. +1 −0  plugins/activedirectory/app/controllers/activedirectory_controller.rb
  2. +2 −2 plugins/activedirectory/app/views/activedirectory/show.html.erb
  3. +7 −0 plugins/activedirectory/package/rubygem-webyast-activedirectory.changes
  4. +2 −1  plugins/roles/app/views/roles/index.html.erb
  5. +0 −3  plugins/services/app/assets/javascripts/webyast-services.js
  6. +6 −0 plugins/services/package/rubygem-webyast-services.changes
  7. +32 −4 plugins/software/app/controllers/patches_controller.rb
  8. +3 −7 plugins/software/app/models/patch.rb
  9. +4 −1 plugins/software/app/models/patches_state.rb
  10. +1 −1  plugins/software/app/views/repositories/new.html.erb
  11. +2 −0  plugins/software/lib/packagekit.rb
  12. +18 −0 plugins/software/package/rubygem-webyast-software.changes
  13. +2 −2 plugins/status/app/views/status/_status_graph.html.erb
  14. +5 −0 plugins/status/package/rubygem-webyast-status.changes
  15. +50 −33 plugins/users/app/assets/javascripts/webyast-users.js
  16. +2 −0  plugins/users/app/views/users/_user_form.erb
  17. +5 −0 plugins/users/package/rubygem-webyast-users.changes
  18. +0 −13 webyast/config/initializers/session_store.rb
  19. +1 −1  webyast/package/rcwebyast
  20. +6 −0 webyast/package/webyast-base.changes
  21. +1 −1  webyast/package/webyast-base.spec
View
1  plugins/activedirectory/app/controllers/activedirectory_controller.rb
@@ -100,6 +100,7 @@ def update
else
Rails.logger.debug "ERROR INSPECT #{e.inspect}"
flash[:error] = _("Error while saving Active Directory client configuration.")
+ render :show and return
end
end
else #REST API
View
4 plugins/activedirectory/app/views/activedirectory/show.html.erb
@@ -30,14 +30,14 @@
$.extend($.validator.messages, { required: <%= jss _("This field is required.") -%> });
if ($("#activedirectory_enabled:checked").length == 0) {
- $("#activedirectory_domain").attr("disabled","disabled");
+ $("#activedirectory_domain, #activedirectory_administrator, #activedirectory_password, #activedirectory_machine", "#activedirectoryForm").attr("disabled","disabled");
}
$("#activedirectory_enabled").click(function () {
if ($("#activedirectory_enabled:checked").length == 0) {
$("#activedirectory_domain").attr("disabled","disabled");
} else {
- $("#activedirectory_domain", "#activedirectoryForm").removeAttr("disabled");
+ $("#activedirectory_domain, #activedirectory_administrator, #activedirectory_password, #activedirectory_machine", "#activedirectoryForm").removeAttr("disabled");
}
});
View
7 plugins/activedirectory/package/rubygem-webyast-activedirectory.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Dec 10 13:47:43 UTC 2012 - lslezak@suse.cz
+
+- fixed generic save error handler
+- the global on/off checkbox also enables/disables account settings
+ input fields
+
+-------------------------------------------------------------------
Tue Dec 4 08:15:03 UTC 2012 - lslezak@suse.cz
- fixed rendering the main page (bnc#792571)
View
3  plugins/roles/app/views/roles/index.html.erb
@@ -165,7 +165,7 @@
</div>
<div class="nav-buttons">
- <%= form_next_button (:id=>'roles_submit_button') %>
+ <%= form_next_button :id=>'roles_submit_button' %>
<%= form_str_spacer %>
<%= form_back_button %>
</div>
@@ -233,6 +233,7 @@
modal: true,
close: clearForm,
buttons: {
+ <%# TODO FIXME: make the button labels translatable -%>
'Create Role': function() {
if ($("#rolesForm").validate().form() == true) {
$(this).children("form").first().submit();
View
3  plugins/services/app/assets/javascripts/webyast-services.js
@@ -20,11 +20,8 @@
$(document).ready(function() {
- console.log("GET STATUS")
$("#services div.list-fieldset").each (function(index) {
-// console.log("GET STATUS")
-
if ($(this).is(":has(span.status_running)")) {
$(this).find(".list-fieldset-header .service-icon").attr('class','service-icon status-icon ok');
View
6 plugins/services/package/rubygem-webyast-services.changes
@@ -5,6 +5,12 @@ Tue Dec 11 20:34:45 UTC 2012 - lslezak@suse.cz
lighttpd
-------------------------------------------------------------------
+Thu Dec 6 09:53:42 UTC 2012 - lslezak@suse.cz
+
+- fixed JS loading in IE9 (console is not available by default)
+ (bnc#783873)
+
+-------------------------------------------------------------------
Thu Nov 1 09:18:43 UTC 2012 - lslezak@suse.cz
- testsuite cleanup
View
36 plugins/software/app/controllers/patches_controller.rb
@@ -23,6 +23,9 @@ class PatchesController < ApplicationController
include ERB::Util
before_filter :cache_check, :only => [:index, :show_summary]
+ before_filter :perm_check, :only => [:index]
+ before_filter :perm_check_summary, :only => [:show_summary]
+
after_filter :drop_cache
# include locale in the cache path to cache different translations
@@ -33,11 +36,11 @@ class PatchesController < ApplicationController
# check permission and validate cache content
def cache_check
- authorize! :read, Patch
-
cached_mtime = Rails.cache.fetch("webyast_patch_mtime")
current_mtime = Patch.mtime
+ Rails.logger.info "cached_mtime: #{cached_mtime.inspect}, current_mtime: #{current_mtime.inspect}"
@vmoravec Owner

The log message is perhaps too generic, I mean there is the 'patch' word missing which would describe what is it about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
if current_mtime != cached_mtime
Rails.logger.info "Expiring patch cache: cached: #{cached_mtime}, modified: #{current_mtime}"
# update the time stamp
@@ -46,6 +49,16 @@ def cache_check
end
end
+ def perm_check
+ authorize! :read, Patch
+ end
+
+ def perm_check_summary
+ if cannot? :read, Patch
+ render :text => _("Status not available (no permissions)")
@vmoravec Owner

Is an explicit return not required after the render call? After the before_filter has been applied, it will go on to execute the show_summary method which is not what we want..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ end
+ end
+
# drop the cached results (needed in some cases, e.g. an error occured, SW management locked)
# to force retry again instead of returning the cached error
def drop_cache
@@ -99,7 +112,8 @@ def reset_results
# GET /patches
# GET /patches.xml
def index
- authorize! :read, Patch
+ # permission checks are done in the before_filter
+
@msgs = read_messages
if params['messages']
Rails.logger.debug "Reading patch messages"
@@ -147,11 +161,16 @@ def index
begin
@patch_updates = Patch.find(:all)
rescue Exception => e
+ Rails.logger.warn "Error while reading patches: #{e.inspect}"
+
if e.description.match /Repository (.*) needs to be signed/
flash[:error] = ((h _("Cannot read patch updates: GPG key for repository %s is not trusted.")) % "<em>#{h $1}</em>").html_safe
elsif e.description.match /System management is locked by the application with pid ([0-9]+) \((.*)\)\./
flash[:warning] = _("Software management is locked by another application ('%s', PID %s).") % [$2, $1]
@drop_cache = true
+ elsif e.description.match /The ZYpp package manager is locked by process ([0-9]+)\. Retry later\./
+ flash[:warning] = _("Software management is locked by another application (PID %s). Available patches cannot be read.") % $1
+ @drop_cache = true
else
flash[:error] = e.message
@drop_cache = true
@@ -193,6 +212,7 @@ def show_summary
patch_updates = nil
ref_timeout = nil
error_type = :none
+
running, remaining = Patch.installing
if running
@@ -213,13 +233,19 @@ def show_summary
patch_updates = patch_updates + collect_done_patches #report also which patches is installed
ref_timeout = refresh_timeout
rescue Exception => error
+ Rails.logger.warn "Caught exception: #{error.inspect}"
+
if error.description.match /Repository (.*) needs to be signed/
- error_string = (_("Cannot read patch updates: GPG key for repository <em>%s</em> is not trusted.") % $1).html_safe
+ error_string = (_("Cannot read patch updates: GPG key for repository <em>%s</em> is not trusted.") % h($1)).html_safe
error_type = :unsigned
elsif error.description.match /System management is locked by the application with pid ([0-9]+) \((.*)\)\./
error_string = _("Software management is locked by another application ('%s', PID %s).") % [$2, $1]
error_type = :locked
@drop_cache = true
+ elsif error.description.match /The ZYpp package manager is locked by process ([0-9]+)\. Retry later\./
+ error_string = _("Software management is locked by another application (PID %s).") % $1
+ error_type = :locked
+ @drop_cache = true
else
error_string = error.message
error_type = :unknown
@@ -256,7 +282,9 @@ def show_summary
:error_string => error_string,
:error_type => error_type,
:refresh_timeout => ref_timeout } }
+ # TODO error handling in JSON and XML
format.json { render :json => patches_summary }
+ format.xml { render :xml => patches_summary }
end
end
View
10 plugins/software/app/models/patch.rb
@@ -288,18 +288,14 @@ def self.install(pk_id)
@messages=[]
ret, error = do_install(pk_id,['RequireRestart','Message']) { |type, details|
Rails.logger.info "Message signal received: #{type}, #{details}"
- if ["system", "application", "session"].include? type
- # RequireRestart received
- type = "notice"
- details = _("Please reboot your system.")
- end
@messages << {:kind => type, :details => details}
begin
dirname = File.dirname(MESSAGES_FILE)
FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
f = File.new(MESSAGES_FILE, 'a+')
- # TODO: make the message traslatable
- f.puts "#{details}"
+ # TODO: make the messages traslatable
+ name, id, arch, repo = pk_id.split(';')
+ f.puts "Patch #{name} from #{repo}: #{details}\n"
rescue Exception => e
Rails.logger.error "writing #{MESSAGES_FILE} file failed: #{e.try(:message)}"
ensure
View
5 plugins/software/app/models/patches_state.rb
@@ -36,10 +36,13 @@ def self.read()
f = File.new(Patch::MESSAGES_FILE, 'r')
messages = f.gets(nil) || ""
+ messages = ERB::Util.html_escape(messages)
+ messages.gsub! "\n", "<br/>"
+
return { :level => "warning",
:message_id => "PATCH_MESSAGES",
:short_description => _("Patch installation messages not confirmed"),
- :long_description => messages,
+ :long_description => messages.html_safe,
:details => "",
:confirmation_link => "/patches/message",
:confirmation_label => _("OK"),
View
2  plugins/software/app/views/repositories/new.html.erb
@@ -92,7 +92,7 @@
// check whether the repository already exists
function check_duplicate()
{
- var repos = <%= @repo_urls.map{|u| escape_javascript u}.to_json -%>;
+ var repos = <%= @repo_urls.to_json.html_safe -%>;
var url = $('#repository_url').val();
for (var i = 0; i < repos.length; i++)
View
2  plugins/software/lib/packagekit.rb
@@ -55,6 +55,7 @@ class PackageKit
def self.improve_error(dbus_error)
# check if it is a known error
if dbus_error.respond_to?('name') && dbus_error.name =~ /org.freedesktop.DBus.Error.([A-Za-z.]*)/
+ Rails.logger.warn "DBUS error: #{$1}"
case $1
when "ServiceUnknown"
return ServiceNotAvailable.new('PackageKit')
@@ -145,6 +146,7 @@ def self.connect
[transaction_iface, packagekit_iface]
rescue DBus::Error => dbus_error
+ Rails.logger.warn "Caught DBus error: #{dbus_error.inspect}"
raise self.improve_error dbus_error
end
View
18 plugins/software/package/rubygem-webyast-software.changes
@@ -1,4 +1,22 @@
-------------------------------------------------------------------
+Wed Dec 12 09:34:18 UTC 2012 - lslezak@suse.cz
+
+- fixed JS rendering at new repository page, allow changing
+ properties of the new repository (bnc#794049)
+
+-------------------------------------------------------------------
+Mon Dec 10 15:08:08 UTC 2012 - lslezak@suse.cz
+
+- display a warning when software management is locked by another
+ application, do not crash (bnc#793602)
+- display patch messages better (bnc#790748)
+
+-------------------------------------------------------------------
+Tue Dec 4 11:42:38 UTC 2012 - lslezak@suse.cz
+
+- fixed rendering permission error in patch summary
+
+-------------------------------------------------------------------
Mon Dec 3 08:25:00 UTC 2012 - lslezak@suse.cz
- fixed accepting patch license, UI fixes
View
4 plugins/status/app/views/status/_status_graph.html.erb
@@ -28,10 +28,10 @@
console.log(empty)
if(empty) {
- console.log("No data available");
+ if (window.console) console.log("No data available");
$('#' + "<%= graph_id(data[:group_id], data[:graph_id])+"_graph" %>").html('<b><%= _("No data available")%></b>');
} else {
- console.log("Draw graph")
+ if (window.console) console.log("Drawing graph");
$.jqplot('<%=graph_id(data[:group_id], data[:graph_id])+"_graph"%>', [
<% counter = 0 %>
View
5 plugins/status/package/rubygem-webyast-status.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Dec 6 15:33:07 UTC 2012 - lslezak@suse.cz
+
+- fixed displaying graphs in IE9 (bnc#792632)
+
+-------------------------------------------------------------------
Fri Nov 23 08:26:19 UTC 2012 - lslezak@suse.cz
- REST API fix - return error when requested metrics was not
View
83 plugins/users/app/assets/javascripts/webyast-users.js
@@ -19,11 +19,14 @@
# you may find current contact information at www.novell.com
*/
+// GLOBAL FIXME: use jQuery properly in this file, avoid plain JS (e.g. [0])
+
// using replace instead of trim() see bnc#580561
function _trim(word){
return word.replace(/^\s*|\s*$/g,'');
}
+// WTF? FIXME: use standard jQuery selectors for this!
function _getElementsByClassName(node, classname) {
if(!node) node = document.getElementsByTagName("body")[0];
var a = [];
@@ -34,25 +37,14 @@ function _getElementsByClassName(node, classname) {
return a;
}
-
-
- // onsubmit handler
+// onsubmit handler
+// FIXME: "message" parameter is not used
function form_handler(sid, message) {
- if ($('#form_' + sid).valid())
- {
-// disable_forms();
-// $('#progress_' + sid).show();
-// blockForm('form_'+sid, message);
-
- return true;
- }
- else
- {
- return false;
- }
+ return $('#form_' + sid).valid();
}
// delete button handler
+// FIXME: "progress" parameter is not used
function delete_handler(which, progress, message){
if (which.childElementCount == 2 && which.children[0].firstChild.textContent == "Delete"){
which.childNodes[0].onclick="return false;";
@@ -77,9 +69,9 @@ function arrays_complement(a1,a2){
function members_validation(which){
var mygroups = [];
if (_trim(which.value).length>0) mygroups = which.value.split(",");
- var allgroups = $("#all_users_string")[0].value.split(",");
- allgroups=allgroups.concat($("#system_users_string")[0].value.split(","));
- errmsg="";
+ var allgroups = $("#all_users_string").val().split(",");
+ allgroups=allgroups.concat($("#system_users_string").val().split(","));
+ var errmsg="";
for (i=0;i<mygroups.length;i++){
var found=false;
for(a=0;a<allgroups.length;a++){
@@ -112,8 +104,8 @@ function findById(where, id){
function groups_validation(which){
var mygroups = _trim(findById(which.parentNode.getElementsByTagName('input'), "user_grp_string").value);
if (mygroups.length>0) mygroups = mygroups.split(",");
- var allgroups = $("#all_grps_string")[0].value.split(",");
- errmsg="";
+ var allgroups = $("#all_grps_string").val().split(",");
+ var errmsg="";
for (i=0;i<mygroups.length;i++){
var found=false;
for(a=0;a<allgroups.length;a++){
@@ -123,7 +115,8 @@ function groups_validation(which){
errmsg = mygroups[i]+" "+"is not valid group!" ;
}
}
- set_tab_focus("groups")
+ set_tab_focus("groups");
+ // WTF? FIXME: use jQuery here!
var error = findById(which.parentNode.parentNode.parentNode.getElementsByTagName('label'), "groups-error");
error.innerHTML = errmsg;
error.style.display= (errmsg.length==0) ? "none" : "block";
@@ -132,8 +125,8 @@ function groups_validation(which){
function def_group_validation(which){
var mygroup = _trim(findById(which.parentNode.getElementsByTagName('input'), "user_groupname").value);
- var allgroups = $("#all_grps_string")[0].value.split(",");
- errmsg="";
+ var allgroups = $("#all_grps_string").val().split(",");
+ var errmsg="";
if (mygroup.length>0){
var found=false;
@@ -141,11 +134,13 @@ function def_group_validation(which){
if (allgroups[a]==_trim(mygroup)) found=true;
}
if (!found){
+ // FIXME: make this translatable
errmsg = mygroup+" "+"is not valid group!" ;
}
}
- set_tab_focus("groups")
+ set_tab_focus("groups");
+ // WTF? FIXME: use jQuery here!
var error = findById(which.parentNode.parentNode.parentNode.getElementsByTagName('label'), "def-group-error");
error.innerHTML = errmsg;
error.style.display= (errmsg.length==0) ? "none" : "block";
@@ -153,20 +148,23 @@ function def_group_validation(which){
}
function roles_validation(which){
+ // WTF? FIXME: use jQuery here!
var myroles = _trim(findById(which.parentNode.getElementsByTagName('input'), "user_roles_string").value);
if (myroles.length>0) myroles = myroles.split(",");
var allroles = $("#all_roles_string")[0].value.split(",");
- errmsg="";
+ var errmsg="";
for (i=0;i<myroles.length;i++){
var found=false;
for(a=0;a<allroles.length;a++){
if (allroles[a]==_trim(myroles[i])) found=true;
}
if (!found){
+ // FIXME: make this translatable
errmsg = myroles[i]+" "+"is not valid role!" ;
}
}
- set_tab_focus("roles")
+ set_tab_focus("roles");
+ // WTF? FIXME: use jQuery here!
var error = findById(which.parentNode.parentNode.parentNode.getElementsByTagName('label'), "roles-error");
error.innerHTML = errmsg;
error.style.display= (errmsg.length==0) ? "none" : "block";
@@ -176,24 +174,27 @@ function roles_validation(which){
function user_exists_validation(el){
var valid = true;
var this_user = el.value;
- users_list = $("#all_users_string").val().split(",");
+ // TODO FIXME: use native JS list (via Array.to_json from Ruby), avoid $("#all_users_string").val().split(",")
+ var users_list = $("#all_users_string").val() == "" ? [] : $("#all_users_string").val().split(",");
+
$.each(users_list, function() {
if(this == this_user) {
- valid = false
- return valid
+ valid = false;
+ return valid;
}
});
- $("#user_name-error")[0].style.display= (valid) ? "none" : "block";
- return valid;
-}
+ $("#user_name-error").toggle(!valid);
+ return valid;
+}
+// FIXME: "which" parameter is not used at all
function user_validation(which, username){
var valid = true;
var form = '#form_'+username;
// for new users test if already not exists
- if (valid && username == ""){
+ if (username == ""){
valid = user_exists_validation();
if (!valid) $(".tabs_").tabs('select',"#tab_login_");
}
@@ -217,6 +218,7 @@ function user_validation(which, username){
function propose_home(login){
+ // FIXME: fix this strange argument checking and overriding
if(arguments.length == 0) {
var login = $("#user_uid").val();
}
@@ -231,3 +233,18 @@ function propose_login(){
propose_home(login);
}
}
+
+function check_uniq_uid_number() {
+ var existing_uid_nums = $("#all_uid_numbers_string").val().split(',');
+ var new_uid_num = $("#user_uid_number").val();
+ var uid_num_exists = false;
+ $.each(existing_uid_nums, function() {
+ if(new_uid_num == this) {
+ uid_num_exists = true;
+ return false;
+ }
+ });
+
+ $('#uid-error').toggle(uid_num_exists);
+}
+
View
2  plugins/users/app/views/users/_user_form.erb
@@ -18,6 +18,7 @@
# To contact Novell about this file by physical or electronic mail,
# you may find current contact information at www.novell.com
-->
+ <%# TODO FIXME: use native JS list (via Array.to_json from Ruby), avoid $("#all_users_string").val().split(",") %>
<input type="hidden" id="all_users_string" value="<%= @all_users_string %>" />
<div class="fieldset-group tabs_<%= user.uid %>">
@@ -154,6 +155,7 @@
<div id="progress_<%= (new ? "" : user.uid) -%>" style="display: none; margin-bottom: 10px"><%= image_tag("working.gif", :class => "small-working-icon") %><span style="vertical-align: 50%; margin-left: 5px">...Wait...</span></div>
<%= submit_tag _("Save"), :onclick=>"return user_validation(this, '"+ (new ? "" : user.uid) +"');", :disabled => disabled %>
<% if can?( :userdelete, User) && !new %>
+ <%# TODO FIXME: set the onclick handler to the link tag, move it to JS file %>
<span onclick="delete_handler(this, '#progress_<%= user.uid -%>', '<%= _('Please wait') -%>');">
<%= link_to _("Delete"),
{:action => 'destroy', :id => user.uid},
View
5 plugins/users/package/rubygem-webyast-users.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Dec 6 11:47:54 UTC 2012 - lslezak@suse.cz
+
+- fixed check for existing user when there is no user defined yet
+
+-------------------------------------------------------------------
Fri Nov 30 11:02:39 UTC 2012 - vmoravec@suse.cz
- show a warning if user uid number exists (bnc#782083)
View
13 webyast/config/initializers/session_store.rb
@@ -16,18 +16,5 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#++
-
-# config.action_controller.session = {
-# :key => '_yast-api_session',
-# # It is overwritten during install time (bnc#550635), do not change key # RORSCAN_INL
-# :secret => '9d11bfc98abcf9799082d9c34ec94dc1cc926f0f1bf4bea8c440b497d96b14c1f712c8784d0303ee7dd69e382c3e5e4d38d4c56d1b619eae7acaa6516cd733b1'
-# }
-
Webyast::Application.config.session_store :cookie_store, :key=> '_webyast_session'
-#Rails.application.config.cookie_secret = '9d11bfc98abcf9799082d9c34ec94dc1cc926f0f1bf4bea8c440b497d96b14c1f712c8784d0303ee7dd69e382c3e5e4d38d4c56d1b619eae7acaa6516cd733b1'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rails generate session_migration")
-# Webyast::Application.config.session_store :active_record_store
View
2  webyast/package/rcwebyast
@@ -207,7 +207,7 @@ case "$1" in
rc_status -v
rc_exit
fi
- sed -i 's/9d11bfc98abcf9799082d9c34ec94dc1cc926f0f1bf4bea8c440b497d96b14c1f712c8784d0303ee7dd69e382c3e5e4d38d4c56d1b619eae7acaa6516cd733b1/'"$SECRET"/ /srv/www/webyast/config/environment.rb
+ sed -i 's/a25bdf1cfcaea649ced4549e9d2b2b6ad4cf077badc774ca034a7ba57ae17f6e1185ed07bcc4ac20fb2d062d2afa975024fca03ede7b4c5002ca68386caa27a0/'"$SECRET"/ /srv/www/webyast/config/initializers/secret_token.rb
# clear cache (drop possibly obsoleted values)
(cd /srv/www/webyast/ && rake -s tmp:cache:clear)
View
6 webyast/package/webyast-base.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Dec 5 12:59:11 UTC 2012 - lslezak@suse.cz
+
+- fixed initializing session secret (for signing cookies) at the
+ first start (bnc#792632)
+
+-------------------------------------------------------------------
Wed Nov 28 17:46:21 UTC 2012 - lslezak@suse.cz
- control panel - logout after 2 hours timeout (bnc#789742)
View
2  webyast/package/webyast-base.spec
@@ -514,7 +514,7 @@ fi
%config /etc/sysconfig/SuSEfirewall2.d/services/webyast
%config /usr/share/%{webyast_polkit_dir}/org.opensuse.yast.permissions.policy
-%config %{webyast_dir}/config/environment.rb
+%config %{webyast_dir}/config/initializers/secret_token.rb
%config(noreplace) /etc/yast_user_roles
%config %{_sysconfdir}/init.d/%{webyast_service}
%{_sbindir}/rc%{webyast_service}
Something went wrong with that request. Please try again.